fix(recipe): output correct formatted json for recipe version
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e609924af0
commit
8a0274cac0
@ -54,8 +54,9 @@ var recipeVersionCommand = cli.Command{
|
||||
logrus.Fatalf("%s has no catalogue published versions?", recipe.Name)
|
||||
}
|
||||
|
||||
tableCols := []string{"version", "service", "image", "tag"}
|
||||
aggregated_table := formatter.CreateTable(tableCols)
|
||||
for i := len(recipeMeta.Versions) - 1; i >= 0; i-- {
|
||||
tableCols := []string{"version", "service", "image", "tag"}
|
||||
table := formatter.CreateTable(tableCols)
|
||||
for version, meta := range recipeMeta.Versions[i] {
|
||||
var versions [][]string
|
||||
@ -67,11 +68,10 @@ var recipeVersionCommand = cli.Command{
|
||||
|
||||
for _, version := range versions {
|
||||
table.Append(version)
|
||||
aggregated_table.Append(version)
|
||||
}
|
||||
|
||||
if internal.MachineReadable {
|
||||
table.JSONRender()
|
||||
} else {
|
||||
if !internal.MachineReadable {
|
||||
table.SetAutoMergeCellsByColumnIndex([]int{0})
|
||||
table.SetAlignment(tablewriter.ALIGN_LEFT)
|
||||
table.Render()
|
||||
@ -79,6 +79,9 @@ var recipeVersionCommand = cli.Command{
|
||||
}
|
||||
}
|
||||
}
|
||||
if internal.MachineReadable {
|
||||
aggregated_table.JSONRender()
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user