Skip to content

Commit

Permalink
Merge pull request #709 from oclif/mdonnalley/json
Browse files Browse the repository at this point in the history
fix: all error and warnings to stderr, this.log in commands
  • Loading branch information
shetzel authored Nov 8, 2023
2 parents b3eb9e9 + 6bdba67 commit 7b8cb30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/commands/plugins/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ e.g. If you have a core plugin that has a 'hello' command, installing a user-ins

YarnMessagesCache.getInstance().flush(plugin)

ux.log(chalk.green(`\nSuccessfully installed ${plugin.name} v${plugin.version}`))
this.log(chalk.green(`\nSuccessfully installed ${plugin.name} v${plugin.version}`))
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ export class YarnMessagesCache {
}

if (plugin) {
ux.log(`\nThese warnings can only be addressed by the owner(s) of ${plugin.name}.`)
ux.logToStderr(`\nThese warnings can only be addressed by the owner(s) of ${plugin.name}.`)

if (plugin.pjson.bugs || plugin.pjson.repository) {
ux.log(
ux.logToStderr(
`We suggest that you create an issue at ${
plugin.pjson.bugs ?? plugin.pjson.repository
} and ask the plugin owners to address them.\n`,
Expand All @@ -143,7 +143,7 @@ export class YarnMessagesCache {
}

if (YarnMessagesCache.errors.size === 0) return
ux.log('\nThe following errors occurred:')
ux.logToStderr('\nThe following errors occurred:')
for (const err of YarnMessagesCache.errors) {
ux.error(err, {exit: false})
}
Expand Down

0 comments on commit 7b8cb30

Please sign in to comment.