aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Alex Lam S.L <alexlamsl@gmail.com> 2023-06-10 07:02:37 +0300
committerGravatar GitHub <noreply@github.com> 2023-06-09 21:02:37 -0700
commitf18423cf450c2fb541ed43f8f088f15c8f0244b2 (patch)
tree8523c71eb74c478b7c5d878fcc451c55b80bdfb3 /src
parent68b9731db2f61652cdc0683cd55c9d8309606a12 (diff)
downloadbun-f18423cf450c2fb541ed43f8f088f15c8f0244b2.tar.gz
bun-f18423cf450c2fb541ed43f8f088f15c8f0244b2.tar.zst
bun-f18423cf450c2fb541ed43f8f088f15c8f0244b2.zip
[install] fix lockfile fallback for life cycle scripts (#3265)bun-v0.6.8
Diffstat (limited to 'src')
-rw-r--r--src/install/install.zig8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/install/install.zig b/src/install/install.zig
index ab3bb3eef..2c4e9404f 100644
--- a/src/install/install.zig
+++ b/src/install/install.zig
@@ -7327,7 +7327,13 @@ pub const PackageManager = struct {
package_json_source,
Features.main,
);
- manager.lockfile.scripts = lockfile.scripts;
+ if (!root.scripts.filled) {
+ maybe_root.scripts.enqueue(
+ manager.lockfile,
+ lockfile.buffers.string_bytes.items,
+ strings.withoutTrailingSlash(Fs.FileSystem.instance.top_level_dir),
+ );
+ }
var mapping = try manager.lockfile.allocator.alloc(PackageID, maybe_root.dependencies.len);
std.mem.set(PackageID, mapping, invalid_package_id);