Skip to content
Closed
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
11 changes: 8 additions & 3 deletions internal/backends/nodejs/nodejs.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,9 +694,14 @@ func makeBunBackend() api.LanguageBackend {
util.RunCmd([]string{"bun", "install", "--save-text-lockfile", "--frozen-lockfile", "--lockfile-only"})
fmt.Fprintln(os.Stderr, "Lock file upgraded.")
}
lockfile := "bun.lock"
if !newBun {
lockfile = "bun.lockb"

// Determine the correct lockfile to use
lockfile := "bun.lockb" // default for older bun versions
if newBun {
// For bun >= 1.2, prefer bun.lock, but fall back to bun.lockb if that's what exists
if commonIsActive("bun.lock") || !commonIsActive("bun.lockb") {
lockfile = "bun.lock"
}
}

b := api.LanguageBackend{
Expand Down
Loading