forked from coop-cloud/abra
fix: correctly count recipes
This commit is contained in:
parent
3119220c21
commit
0a550363b8
|
@ -40,6 +40,7 @@ var recipeListCommand = &cli.Command{
|
|||
tableCol := []string{"name", "category", "status", "healthcheck", "backups", "email", "tests", "SSO"}
|
||||
table := formatter.CreateTable(tableCol)
|
||||
|
||||
len := 0
|
||||
for _, recipe := range recipes {
|
||||
tableRow := []string{
|
||||
recipe.Name,
|
||||
|
@ -55,13 +56,15 @@ var recipeListCommand = &cli.Command{
|
|||
if pattern != "" {
|
||||
if strings.Contains(recipe.Name, pattern) {
|
||||
table.Append(tableRow)
|
||||
len++
|
||||
}
|
||||
} else {
|
||||
table.Append(tableRow)
|
||||
len++
|
||||
}
|
||||
}
|
||||
|
||||
table.SetCaption(true, fmt.Sprintf("total recipes: %v", len(recipes)))
|
||||
table.SetCaption(true, fmt.Sprintf("total recipes: %v", len))
|
||||
|
||||
if table.NumLines() > 0 {
|
||||
table.Render()
|
||||
|
|
Loading…
Reference in New Issue