Skip to content

Commit 0890917

Browse files
authored
fix: only show warnings when json is not enabled (#260)
* fix: only show warnings when json is not enabled * fix: return warnings from warn method * chore: remove semicolon
1 parent aba80e8 commit 0890917

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/command.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,9 @@ export default abstract class Command {
174174
return Errors.exit(code)
175175
}
176176

177-
warn(input: string | Error): void {
178-
Errors.warn(input)
177+
warn(input: string | Error): string | Error {
178+
if (!this.jsonEnabled()) Errors.warn(input)
179+
return input
179180
}
180181

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

0 commit comments

Comments
 (0)