diff options
author | Michele Azzolari <michele@azzolari.it> | 2020-10-30 09:22:10 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2020-10-30 20:33:51 +0300 |
commit | 2636fe1f45383cb1b6fc164564dc49318815db37 (patch) | |
tree | f1d244b35fe8f6249ac18a93b74516ed8376104d | |
parent | 2a680e91a2be1f3f03a6fbd946f74628ee1cb370 (diff) |
fix: in run-script, if loglevel is silent, disable banner option
Fixes issue #2023
PR-URL: https://github.com/npm/cli/pull/2086
Credit: @macno
Close: #2086
Reviewed-by: @nlf
-rw-r--r-- | lib/run-script.js | 1 | ||||
-rw-r--r-- | test/lib/run-script.js | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/run-script.js b/lib/run-script.js index 2802c54ba..4d27e8eed 100644 --- a/lib/run-script.js +++ b/lib/run-script.js @@ -71,6 +71,7 @@ const runScript = async (args) => { stdio: 'inherit', stdioString: true, pkg, + banner: log.level !== 'silent', } for (const [event, args] of events) { diff --git a/test/lib/run-script.js b/test/lib/run-script.js index 9f48b8f59..7a034aff0 100644 --- a/test/lib/run-script.js +++ b/test/lib/run-script.js @@ -253,6 +253,7 @@ t.test('skip pre/post hooks when using ignoreScripts', async t => { postenv: 'echo after the env', env: 'env' } }, + banner: true, event: 'env' } ]) @@ -295,7 +296,8 @@ t.test('run silent', async t => { pkg: { name: 'x', version: '1.2.3', _id: 'x@1.2.3', scripts: { env: 'env' } }, - event: 'env' + event: 'env', + banner: false }, { event: 'postenv', |