Skip to content

Commit

Permalink
fix: don't save lockfile if --frozen-lockfile or --no-save
Browse files Browse the repository at this point in the history
  • Loading branch information
pikdum committed Feb 21, 2025
1 parent 5aa8b1d commit eb649a4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/install/install.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7562,6 +7562,7 @@ pub const PackageManager = struct {
if (cli.no_save) {
this.do.save_lockfile = false;
this.do.write_package_json = false;
this.enable.frozen_lockfile = true;
}

if (cli.dry_run) {
Expand Down Expand Up @@ -15254,6 +15255,8 @@ pub const PackageManager = struct {

// It's unnecessary work to re-save the lockfile if there are no changes
const should_save_lockfile =
// never save if frozen
!manager.options.enable.frozen_lockfile and
(load_result == .ok and ((load_result.ok.format == .binary and save_format == .text) or

// make sure old versions are updated
Expand Down

0 comments on commit eb649a4

Please sign in to comment.