Skip to content

Commit

Permalink
Merge pull request #171 from terracatta/jem_add_gitattributes
Browse files Browse the repository at this point in the history
Add lockb diffing support for Bun
  • Loading branch information
rafaelfranca authored Sep 12, 2023
2 parents e308e76 + 5d00432 commit 531a39b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/install/bun/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# See https://bun.sh/docs/install/lockfile
*.lockb diff=lockb
8 changes: 8 additions & 0 deletions lib/install/bun/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@
package_json["scripts"] ||= {}
package_json["scripts"]["build"] = "bun bun.config.js"
File.write("package.json", JSON.pretty_generate(package_json))

say "Add ability to diff lockb to .gitattributes"
if Rails.root.join(".gitattributes").exist?
append_to_file ".gitattributes", "\n# See https://bun.sh/docs/install/lockfile\n*.lockb diff=lockb\n"
else
copy_file "#{__dir__}/.gitattributes", ".gitattributes"
end
say %(Run `git config diff.lockb.textconv bun && git config diff.lockb.binary true` to enable pretty diffs for Bun's .lockb file), :green

0 comments on commit 531a39b

Please sign in to comment.