fix: in run-script, if loglevel is silent, disable banner option · npm/cli@2636fe1 (original) (raw)
Commit 2636fe1
authored and
committed
fix: in run-script, if loglevel is silent, disable banner option
Fixes issue #2023PR-URL: #2086Credit: @macno Close: #2086Reviewed-by: @nlf
File tree
2 files changed
lines changed
2 files changed
lines changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -71,6 +71,7 @@ const runScript = async (args) => { | ||
| 71 | 71 | stdio: 'inherit', |
| 72 | 72 | stdioString: true, |
| 73 | 73 | pkg, |
| 74 | +banner: log.level !== 'silent', | |
| 74 | 75 | } |
| 75 | 76 | |
| 76 | 77 | for (const [event, args] of events) { |
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -253,6 +253,7 @@ t.test('skip pre/post hooks when using ignoreScripts', async t => { | ||
| 253 | 253 | postenv: 'echo after the env', |
| 254 | 254 | env: 'env' |
| 255 | 255 | } }, |
| 256 | +banner: true, | |
| 256 | 257 | event: 'env' |
| 257 | 258 | } |
| 258 | 259 | ]) |
| @@ -295,7 +296,8 @@ t.test('run silent', async t => { | ||
| 295 | 296 | pkg: { name: 'x', version: '1.2.3', _id: 'x@1.2.3', scripts: { |
| 296 | 297 | env: 'env' |
| 297 | 298 | } }, |
| 298 | -event: 'env' | |
| 299 | +event: 'env', | |
| 300 | +banner: false | |
| 299 | 301 | }, |
| 300 | 302 | { |
| 301 | 303 | event: 'postenv', |