Skip to content

Commit

Permalink
Merge pull request docker#2374 from tonistiigi/print-json-format
Browse files Browse the repository at this point in the history
handle json formatting for print
  • Loading branch information
crazy-max authored Apr 5, 2024
2 parents 6a0d5b7 + 858e347 commit 5c29e6e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commands/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,9 @@ func printResult(f *controllerapi.PrintFunc, res map[string]string) error {
case "subrequests.describe":
return printValue(subrequests.PrintDescribe, subrequests.SubrequestsDescribeDefinition.Version, f.Format, res)
default:
if dt, ok := res["result.txt"]; ok {
if dt, ok := res["result.json"]; ok && f.Format == "json" {
fmt.Println(dt)
} else if dt, ok := res["result.txt"]; ok {
fmt.Print(dt)
} else {
log.Printf("%s %+v", f, res)
Expand Down

0 comments on commit 5c29e6e

Please sign in to comment.