Skip to content

Commit

Permalink
fix(cli): fix error rendering for yaml output
Browse files Browse the repository at this point in the history
Before this fix, any errors in command results would not be rendered
(instead, an empty array was rendered).
  • Loading branch information
thsig authored and edvald committed Oct 14, 2020
1 parent accbd32 commit 37d21cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/cli/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export const OUTPUT_RENDERERS = {
return stringify(data, null, 2)
},
yaml: (data: DeepPrimitiveMap) => {
return safeDumpYaml(data, { noRefs: true })
// Convert data to JSON object so that `safeDumpYaml` renders any errors.
return safeDumpYaml(JSON.parse(JSON.stringify(data)), { noRefs: true })
},
}

Expand Down

0 comments on commit 37d21cf

Please sign in to comment.