Skip to content

Commit 531a39b

Browse files
authored
Merge pull request #171 from terracatta/jem_add_gitattributes
Add lockb diffing support for Bun
2 parents e308e76 + 5d00432 commit 531a39b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/install/bun/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# See https://bun.sh/docs/install/lockfile
2+
*.lockb diff=lockb

lib/install/bun/install.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@
1818
package_json["scripts"] ||= {}
1919
package_json["scripts"]["build"] = "bun bun.config.js"
2020
File.write("package.json", JSON.pretty_generate(package_json))
21+
22+
say "Add ability to diff lockb to .gitattributes"
23+
if Rails.root.join(".gitattributes").exist?
24+
append_to_file ".gitattributes", "\n# See https://bun.sh/docs/install/lockfile\n*.lockb diff=lockb\n"
25+
else
26+
copy_file "#{__dir__}/.gitattributes", ".gitattributes"
27+
end
28+
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 commit comments

Comments
 (0)