fix: counts apps + drop versions meta without -S

This commit is contained in:
decentral1se 2021-11-21 13:40:23 +01:00
parent 304b70639f
commit ecd2a63f0a
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 16 additions and 8 deletions

View File

@ -106,9 +106,12 @@ can take some time.
logrus.Fatal(err)
}
var appsCount int
for _, app := range apps {
var tableRow []string
if app.Type == appType || appType == "" {
appsCount++
// If type flag is set, check for it, if not, Type == ""
tableRow = []string{app.Server, app.Type, app.Domain}
if status {
@ -174,14 +177,19 @@ can take some time.
table.Append(tableRow)
}
stats := fmt.Sprintf(
"Total apps: %v | Versioned: %v | Unversioned: %v | On latest: %v | Can upgrade: %v",
len(apps),
versionedAppsCount,
unversionedAppsCount,
onLatestCount,
canUpgradeCount,
)
var stats string
if status {
stats = fmt.Sprintf(
"Total apps: %v | Versioned: %v | Unversioned: %v | On latest: %v | Can upgrade: %v",
appsCount,
versionedAppsCount,
unversionedAppsCount,
onLatestCount,
canUpgradeCount,
)
} else {
stats = fmt.Sprintf("Total apps: %v", appsCount)
}
table.SetCaption(true, stats)
table.Render()