refactor: centralise recipe validation

This commit is contained in:
2021-09-06 00:45:13 +02:00
parent 691a2c7a50
commit a0625bf133
8 changed files with 14 additions and 12 deletions

View File

@ -19,16 +19,21 @@ var recipeListCommand = &cli.Command{
if err != nil {
logrus.Fatal(err.Error())
}
recipes := catl.Flatten()
sort.Sort(catalogue.ByRecipeName(recipes))
tableCol := []string{"Name", "Category", "Status"}
table := formatter.CreateTable(tableCol)
for _, recipe := range recipes {
status := fmt.Sprintf("%v", recipe.Features.Status)
tableRow := []string{recipe.Name, recipe.Category, status}
table.Append(tableRow)
}
table.Render()
return nil
},
}