mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 17:37:46 +08:00
Merge pull request #2374 from tonistiigi/print-json-format
handle json formatting for print
This commit is contained in:
commit
5c29e6e26e
@ -852,7 +852,9 @@ func printResult(f *controllerapi.PrintFunc, res map[string]string) error {
|
|||||||
case "subrequests.describe":
|
case "subrequests.describe":
|
||||||
return printValue(subrequests.PrintDescribe, subrequests.SubrequestsDescribeDefinition.Version, f.Format, res)
|
return printValue(subrequests.PrintDescribe, subrequests.SubrequestsDescribeDefinition.Version, f.Format, res)
|
||||||
default:
|
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)
|
fmt.Print(dt)
|
||||||
} else {
|
} else {
|
||||||
log.Printf("%s %+v", f, res)
|
log.Printf("%s %+v", f, res)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user