Skip to content

Commit

Permalink
improve kool status output - fetch all services even if no container
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciojs committed Oct 28, 2023
1 parent 8fb1048 commit 1695795
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions commands/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func NewKoolStatus() *KoolStatus {
checker.NewChecker(defaultKoolService.shell),
network.NewHandler(defaultKoolService.shell),
environment.NewEnvStorage(),
builder.NewCommand("docker", "compose", "ps", "--all", "--services"),
builder.NewCommand("docker", "compose", "config", "--services"),
builder.NewCommand("docker", "compose", "ps", "--all", "--quiet"),
builder.NewCommand("docker", "ps", "--all", "--format", "{{.Status}}|{{.Ports}}"),
shell.NewTableWriter(),
Expand All @@ -65,7 +65,9 @@ func (s *KoolStatus) Execute(args []string) (err error) {
return
}

if services, err = s.getServices(); err != nil || len(services) == 0 {
if services, err = s.getServices(); err != nil {
return
} else if len(services) == 0 {
s.Shell().Warning("No services found.")
return
}
Expand Down

0 comments on commit 1695795

Please sign in to comment.