forked from toolshed/abra
test: int suite fixes
This commit is contained in:
@ -61,7 +61,6 @@ var recipeVersionCommand = cli.Command{
|
||||
log.Fatalf("%s has no published versions?", recipe.Name)
|
||||
}
|
||||
|
||||
var allRows [][]string
|
||||
for i := len(recipeMeta.Versions) - 1; i >= 0; i-- {
|
||||
table, err := formatter.CreateTable()
|
||||
if err != nil {
|
||||
@ -71,6 +70,7 @@ var recipeVersionCommand = cli.Command{
|
||||
table.Headers("SERVICE", "NAME", "TAG")
|
||||
|
||||
for version, meta := range recipeMeta.Versions[i] {
|
||||
var allRows [][]string
|
||||
var rows [][]string
|
||||
|
||||
for service, serviceMeta := range meta {
|
||||
@ -86,6 +86,18 @@ var recipeVersionCommand = cli.Command{
|
||||
fmt.Println(table)
|
||||
log.Infof("VERSION: %s", version)
|
||||
fmt.Println()
|
||||
continue
|
||||
}
|
||||
|
||||
if internal.MachineReadable {
|
||||
sort.Slice(allRows, sortServiceByName(allRows))
|
||||
headers := []string{"VERSION", "SERVICE", "NAME", "TAG"}
|
||||
out, err := formatter.ToJSON(headers, allRows)
|
||||
if err != nil {
|
||||
log.Fatal("unable to render to JSON: %s", err)
|
||||
}
|
||||
fmt.Println(out)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -96,17 +108,6 @@ var recipeVersionCommand = cli.Command{
|
||||
}
|
||||
}
|
||||
|
||||
if internal.MachineReadable {
|
||||
sort.Slice(allRows, sortServiceByName(allRows))
|
||||
headers := []string{"VERSION", "SERVICE", "NAME", "TAG"}
|
||||
out, err := formatter.ToJSON(headers, allRows)
|
||||
if err != nil {
|
||||
log.Fatal("unable to render to JSON: %s", err)
|
||||
}
|
||||
fmt.Println(out)
|
||||
return nil
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user