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"}
|
tableCol := []string{"name", "category", "status", "healthcheck", "backups", "email", "tests", "SSO"}
|
||||||
table := formatter.CreateTable(tableCol)
|
table := formatter.CreateTable(tableCol)
|
||||||
|
|
||||||
|
len := 0
|
||||||
for _, recipe := range recipes {
|
for _, recipe := range recipes {
|
||||||
tableRow := []string{
|
tableRow := []string{
|
||||||
recipe.Name,
|
recipe.Name,
|
||||||
|
@ -55,13 +56,15 @@ var recipeListCommand = &cli.Command{
|
||||||
if pattern != "" {
|
if pattern != "" {
|
||||||
if strings.Contains(recipe.Name, pattern) {
|
if strings.Contains(recipe.Name, pattern) {
|
||||||
table.Append(tableRow)
|
table.Append(tableRow)
|
||||||
|
len++
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
table.Append(tableRow)
|
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 {
|
if table.NumLines() > 0 {
|
||||||
table.Render()
|
table.Render()
|
||||||
|
|
Loading…
Reference in New Issue