diff --git a/commands/build.go b/commands/build.go index 662640a3..36154599 100644 --- a/commands/build.go +++ b/commands/build.go @@ -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)