Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Garvin <gar+gh@danger.computer>2021-01-07 20:14:09 +0300
committerisaacs <i@izs.me>2021-01-07 23:44:29 +0300
commit907b34b2ecc34ac376d989f824f7492064e43ef4 (patch)
tree7bac484eca5f34dc8fd2a2f454eb16179e90069c /lib
parent99156df8099f55bc69dfa99d7ddcf8d1d569016e (diff)
fix(ci): pay attention to --ignore-scripts
Added a test for install too for this specific condition PR-URL: https://github.com/npm/cli/pull/2455 Credit: @wraithgar Close: #2455 Reviewed-by: @isaacs
Diffstat (limited to 'lib')
-rw-r--r--lib/ci.js40
1 files changed, 21 insertions, 19 deletions
diff --git a/lib/ci.js b/lib/ci.js
index 2917899c8..89c6b8f42 100644
--- a/lib/ci.js
+++ b/lib/ci.js
@@ -21,7 +21,7 @@ const ci = async () => {
}
const where = npm.prefix
- const { scriptShell } = npm.flatOptions
+ const { scriptShell, ignoreScripts } = npm.flatOptions
const arb = new Arborist({ ...npm.flatOptions, path: where })
await Promise.all([
@@ -39,24 +39,26 @@ const ci = async () => {
await arb.reify({ ...npm.flatOptions, save: false })
// run the same set of scripts that `npm install` runs.
- const scripts = [
- 'preinstall',
- 'install',
- 'postinstall',
- 'prepublish', // XXX should we remove this finally??
- 'preprepare',
- 'prepare',
- 'postprepare',
- ]
- for (const event of scripts) {
- await runScript({
- path: where,
- args: [],
- scriptShell,
- stdio: 'inherit',
- stdioString: true,
- event,
- })
+ if (!ignoreScripts) {
+ const scripts = [
+ 'preinstall',
+ 'install',
+ 'postinstall',
+ 'prepublish', // XXX should we remove this finally??
+ 'preprepare',
+ 'prepare',
+ 'postprepare',
+ ]
+ for (const event of scripts) {
+ await runScript({
+ path: where,
+ args: [],
+ scriptShell,
+ stdio: 'inherit',
+ stdioString: true,
+ event,
+ })
+ }
}
await reifyFinish(arb)
}