fix: counts apps + drop versions meta without -S
This commit is contained in:
parent
304b70639f
commit
ecd2a63f0a
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user