Skip to content

Commit c844896

Browse files
theandrewlanebestander
authored andcommitted
Bugfix #5614: When offline pruning, don't unlink prebuilt packages. (#5616)
1 parent 4cbecf1 commit c844896

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cli/commands/install.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,9 @@ export class Install {
767767
const mirrorFiles = await fs.walk(mirror);
768768
for (const file of mirrorFiles) {
769769
const isTarball = path.extname(file.basename) === '.tgz';
770-
if (isTarball && !requiredTarballs.has(file.basename)) {
770+
// if using experimental-pack-script-packages-in-mirror flag, don't unlink prebuilt packages
771+
const hasPrebuiltPackage = file.relative.startsWith('prebuilt/');
772+
if (isTarball && !hasPrebuiltPackage && !requiredTarballs.has(file.basename)) {
771773
await fs.unlink(file.absolute);
772774
}
773775
}

0 commit comments

Comments
 (0)