Skip to content

Commit

Permalink
fix: in run-script, if loglevel is silent, disable banner option
Browse files Browse the repository at this point in the history
Fixes issue #2023

PR-URL: #2086
Credit: @macno
Close: #2086
Reviewed-by: @nlf
  • Loading branch information
macno authored and ruyadorno committed Oct 30, 2020
1 parent 2a680e9 commit 2636fe1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/run-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const runScript = async (args) => {
stdio: 'inherit',
stdioString: true,
pkg,
banner: log.level !== 'silent',
}

for (const [event, args] of events) {
Expand Down
4 changes: 3 additions & 1 deletion test/lib/run-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
])
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 2636fe1

Please sign in to comment.