Skip to content

Commit 4d88ba9

Browse files
committed
fix: log -> silent
1 parent 306bf7d commit 4d88ba9

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/commands/publish.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class Publish extends BaseCommand {
5555
const json = this.npm.config.get('json')
5656
const defaultTag = this.npm.config.get('tag')
5757
const ignoreScripts = this.npm.config.get('ignore-scripts')
58-
const silent = log.level === 'silent'
5958

6059
if (semver.validRange(defaultTag)) {
6160
throw new Error('Tag name must not be a valid SemVer range: ' + defaultTag.trim())
@@ -79,7 +78,7 @@ class Publish extends BaseCommand {
7978
path: spec.fetchSpec,
8079
stdio: 'inherit',
8180
pkg: manifest,
82-
banner: !silent,
81+
banner: !opts.silent,
8382
})
8483
}
8584

@@ -123,22 +122,22 @@ class Publish extends BaseCommand {
123122
path: spec.fetchSpec,
124123
stdio: 'inherit',
125124
pkg: manifest,
126-
banner: !silent,
125+
banner: !opts.silent,
127126
})
128127

129128
await runScript({
130129
event: 'postpublish',
131130
path: spec.fetchSpec,
132131
stdio: 'inherit',
133132
pkg: manifest,
134-
banner: !silent,
133+
banner: !opts.silent,
135134
})
136135
}
137136

138137
if (!this.suppressOutput) {
139-
if (!silent && json) {
138+
if (!opts.silent && json) {
140139
this.npm.output(JSON.stringify(pkgContents, null, 2))
141-
} else if (!silent) {
140+
} else if (!opts.silent) {
142141
this.npm.output(`+ ${pkgContents.id}`)
143142
}
144143
}
@@ -152,7 +151,7 @@ class Publish extends BaseCommand {
152151

153152
const results = {}
154153
const json = this.npm.config.get('json')
155-
const silent = log.level === 'silent'
154+
const silent = this.npm.flatOptions.silent === 'silent'
156155
const noop = a => a
157156
const color = this.npm.color ? chalk : { green: noop, bold: noop }
158157
await this.setWorkspaces(filters)

0 commit comments

Comments
 (0)