Skip to content

Commit c94bf81

Browse files
committed
fix: Output JSON in WASM binary
Signed-off-by: Arthur Amstutz <arthur.amstutz@corp.ovh.com>
1 parent b13294c commit c94bf81

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

internal/display/display_wasm.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,14 @@ func exitError(message string, params ...any) {
110110
}
111111

112112
func outputf(message string, params ...any) {
113-
ResultString = fmt.Sprintf(message, params...)
113+
valueOut := &OutputMessage{
114+
Message: fmt.Sprintf(message, params...),
115+
}
116+
117+
if err := prettyPrintJSON(valueOut); err != nil {
118+
exitError("error displaying JSON results: %s", err)
119+
return
120+
}
114121
}
115122

116123
func OutputInfo(outputFormat *OutputFormat, details any, message string, params ...any) {

0 commit comments

Comments
 (0)