diff options
author | Michael Garvin <gar+gh@danger.computer> | 2021-01-07 20:14:09 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2021-01-07 23:44:29 +0300 |
commit | 907b34b2ecc34ac376d989f824f7492064e43ef4 (patch) | |
tree | 7bac484eca5f34dc8fd2a2f454eb16179e90069c /lib | |
parent | 99156df8099f55bc69dfa99d7ddcf8d1d569016e (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.js | 40 |
1 files changed, 21 insertions, 19 deletions
@@ -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) } |