fix: if all servers good, don't show empty table
continuous-integration/drone/push Build is passing Details

This commit is contained in:
decentral1se 2023-02-19 10:34:47 +01:00
parent d62c4e3400
commit 3058178d84
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 11 additions and 5 deletions

View File

@ -39,11 +39,7 @@ var serverListCommand = cli.Command{
tableColumns := []string{"name", "host", "user", "port"}
table := formatter.CreateTable(tableColumns)
if internal.MachineReadable {
defer table.JSONRender()
} else {
defer table.Render()
}
serverNames, err := config.ReadServerNames()
if err != nil {
logrus.Fatal(err)
@ -84,6 +80,16 @@ var serverListCommand = cli.Command{
}
}
if internal.MachineReadable {
table.JSONRender()
} else {
if problemsFilter && table.NumLines() == 0 {
logrus.Info("all servers wired up correctly 👏")
} else {
table.Render()
}
}
return nil
},
}