Skip to content

Commit

Permalink
chore: return valid JSON string from showError
Browse files Browse the repository at this point in the history
  • Loading branch information
nsalamad committed Aug 9, 2023
1 parent 567553a commit a1bda2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/commands/variations/__snapshots__/create.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ exports[`variations create creates a variation and returns the full feature in i
`;

exports[`variations create errors when missing required flags in headless mode 1`] = `
"key is a required field
name is a required field
"key is a required field
name is a required field
"
`;

Expand Down
6 changes: 5 additions & 1 deletion src/ui/writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ export default class Writer {
}

public showError(message: string): void {
console.log(chalk.red(`❌ ${message}`))
if (this.headless) {
console.log(message)
} else {
console.log(chalk.red(`❌ ${message}`))
}
}

public headless: boolean
Expand Down

0 comments on commit a1bda2d

Please sign in to comment.