Skip to content

Commit

Permalink
pretty print response from invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Vlasic committed Aug 17, 2021
1 parent d17ca30 commit bb76fb1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/commands/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ func PrintProjectRequest(url string, req string, includeHeaders, includeLogs boo
return err
}
if string(buf) != "" {
fmt.Printf("%s\n", string(buf))
dst := &bytes.Buffer{}
if err := json.Indent(dst, buf, "", " "); err != nil {
fmt.Println(string(buf))
} else {
fmt.Println(dst.String())
}
}
return nil
}
Expand Down

0 comments on commit bb76fb1

Please sign in to comment.