From 0919bd3b4f5cb1d1da33043bf2f4ae1a7e20f16c Mon Sep 17 00:00:00 2001 From: Michele Azzolari Date: Fri, 30 Oct 2020 07:22:10 +0100 Subject: [PATCH] fix: in run-script, if loglevel is silent, disable banner option Fixes issue #2023 --- lib/run-script.js | 1 + test/lib/run-script.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/run-script.js b/lib/run-script.js index 2802c54ba51a5..4d27e8eed965e 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 9f48b8f59bbeb..7a034aff01561 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',