Skip to content

Commit

Permalink
fix: only show warnings when json is not enabled (#260)
Browse files Browse the repository at this point in the history
* fix: only show warnings when json is not enabled

* fix: return warnings from warn method

* chore: remove semicolon
  • Loading branch information
mdonnalley committed Sep 29, 2021
1 parent aba80e8 commit 0890917
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/command.ts
Expand Up @@ -174,8 +174,9 @@ export default abstract class Command {
return Errors.exit(code)
}

warn(input: string | Error): void {
Errors.warn(input)
warn(input: string | Error): string | Error {
if (!this.jsonEnabled()) Errors.warn(input)
return input
}

error(input: string | Error, options: {code?: string; exit: false} & PrettyPrintableError): void
Expand Down

0 comments on commit 0890917

Please sign in to comment.