Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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