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

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(
var stats string
if status {
stats = fmt.Sprintf(
"Total apps: %v | Versioned: %v | Unversioned: %v | On latest: %v | Can upgrade: %v",
len(apps),
appsCount,
versionedAppsCount,
unversionedAppsCount,
onLatestCount,
canUpgradeCount,
)
} else {
stats = fmt.Sprintf("Total apps: %v", appsCount)
}
table.SetCaption(true, stats)
table.Render()