Skip to content

Commit 0071184

Browse files
committed
fix(runScript): obey silent loglevel
If the user has specified a silent loglevel, we should pass that intention on when we call runScript Also a small cleanup in lib/run-script.js so that the reference to @npmcli/run-script is named the same as other files.
1 parent e703362 commit 0071184

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

lib/ci.js

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ const ci = async () => {
6868
scriptShell,
6969
stdio: 'inherit',
7070
stdioString: true,
71+
banner: log.level !== 'silent',
7172
event,
7273
})
7374
}

lib/install.js

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const install = async args => {
5757
scriptShell,
5858
stdio: 'inherit',
5959
stdioString: true,
60+
banner: log.level !== 'silent',
6061
event,
6162
})
6263
}

lib/publish.js

+3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ const publish_ = async (arg, opts) => {
8585
path: spec.fetchSpec,
8686
stdio: 'inherit',
8787
pkg: manifest,
88+
banner: log.level !== 'silent',
8889
})
8990
}
9091

@@ -121,13 +122,15 @@ const publish_ = async (arg, opts) => {
121122
path: spec.fetchSpec,
122123
stdio: 'inherit',
123124
pkg: manifest,
125+
banner: log.level !== 'silent',
124126
})
125127

126128
await runScript({
127129
event: 'postpublish',
128130
path: spec.fetchSpec,
129131
stdio: 'inherit',
130132
pkg: manifest,
133+
banner: log.level !== 'silent',
131134
})
132135
}
133136

lib/run-script.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const run = require('@npmcli/run-script')
2-
const { isServerPackage } = run
1+
const runScript = require('@npmcli/run-script')
2+
const { isServerPackage } = runScript
33
const npm = require('./npm.js')
44
const readJson = require('read-package-json-fast')
55
const { resolve } = require('path')
@@ -27,11 +27,11 @@ const completion = async (opts, cb) => {
2727
}
2828

2929
const cmd = (args, cb) => {
30-
const fn = args.length ? runScript : list
30+
const fn = args.length ? doRun : list
3131
return fn(args).then(() => cb()).catch(cb)
3232
}
3333

34-
const runScript = async (args) => {
34+
const doRun = async (args) => {
3535
const path = npm.localPrefix
3636
const event = args.shift()
3737
const { scriptShell } = npm.flatOptions
@@ -76,7 +76,7 @@ const runScript = async (args) => {
7676
}
7777

7878
for (const [event, args] of events) {
79-
await run({
79+
await runScript({
8080
...opts,
8181
event,
8282
args,

0 commit comments

Comments
 (0)