Skip to content

Commit

Permalink
Improve error message on docker compose check failure
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciojs committed Dec 27, 2022
1 parent 8f53b80 commit 4754670
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion services/checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package checker
import (
"kool-dev/kool/core/builder"
"kool-dev/kool/core/shell"
"strings"
)

// Checker defines the check kool dependencies method
Expand Down Expand Up @@ -33,7 +34,11 @@ func (c *DefaultChecker) Check() error {
}

if _, err := c.shell.Exec(c.dockerComposeCmd); err != nil {
return ErrDockerComposeNotFound
if strings.Contains(strings.ToLower(err.Error()), "is not a docker command") {
return ErrDockerComposeNotFound
}
// anything else, raise the original error
return err
}

if _, err := c.shell.Exec(c.dockerCmd); err != nil {
Expand Down

0 comments on commit 4754670

Please sign in to comment.