From f3fb1102ff83fbdef53855767ee3902c53d17639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Nison?= Date: Fri, 14 Dec 2018 19:00:38 +0000 Subject: [PATCH] Stops unplugging packages when the install scripts are disabled (#6820) * Stops unplugging packages when the install scripts are disabled * Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ src/package-linker.js | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4383f84586..51c2d8d0aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa [#6712](https://github.com/yarnpkg/yarn/pull/6712) - [**Maël Nison**](https://twitter.com/arcanis) +- Stops automatically unplugging packages with postinstall script when running under `--ignore-scripts` + + [#6820](https://github.com/yarnpkg/yarn/pull/6820) - [**Maël Nison**](https://twitter.com/arcanis) + - Adds transparent support for the [`resolve`](https://github.com/browserify/resolve) package when using Plug'n'Play [#6816](https://github.com/yarnpkg/yarn/pull/6816) - [**Maël Nison**](https://twitter.com/arcanis) diff --git a/src/package-linker.js b/src/package-linker.js index 66308d2221..0a8a8931a7 100644 --- a/src/package-linker.js +++ b/src/package-linker.js @@ -698,7 +698,11 @@ export default class PackageLinker { } // If the package has a postinstall script, we also unplug it (otherwise they would run into the cache) - if (pkg.scripts && (pkg.scripts.preinstall || pkg.scripts.install || pkg.scripts.postinstall)) { + if ( + !this.config.ignoreScripts && + pkg.scripts && + (pkg.scripts.preinstall || pkg.scripts.install || pkg.scripts.postinstall) + ) { return true; }