Skip to content

Commit f3fb110

Browse files
authored
Stops unplugging packages when the install scripts are disabled (#6820)
* Stops unplugging packages when the install scripts are disabled * Update CHANGELOG.md
1 parent 1cf0490 commit f3fb110

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa
2828

2929
[#6712](https://github.com/yarnpkg/yarn/pull/6712) - [**Maël Nison**](https://twitter.com/arcanis)
3030

31+
- Stops automatically unplugging packages with postinstall script when running under `--ignore-scripts`
32+
33+
[#6820](https://github.com/yarnpkg/yarn/pull/6820) - [**Maël Nison**](https://twitter.com/arcanis)
34+
3135
- Adds transparent support for the [`resolve`](https://github.com/browserify/resolve) package when using Plug'n'Play
3236

3337
[#6816](https://github.com/yarnpkg/yarn/pull/6816) - [**Maël Nison**](https://twitter.com/arcanis)

src/package-linker.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,11 @@ export default class PackageLinker {
698698
}
699699

700700
// If the package has a postinstall script, we also unplug it (otherwise they would run into the cache)
701-
if (pkg.scripts && (pkg.scripts.preinstall || pkg.scripts.install || pkg.scripts.postinstall)) {
701+
if (
702+
!this.config.ignoreScripts &&
703+
pkg.scripts &&
704+
(pkg.scripts.preinstall || pkg.scripts.install || pkg.scripts.postinstall)
705+
) {
702706
return true;
703707
}
704708

0 commit comments

Comments
 (0)