Skip to content

Commit

Permalink
fix(cli): check for docker-compose on installer (#3234)
Browse files Browse the repository at this point in the history
  • Loading branch information
schoren authored Oct 9, 2023
1 parent e7dd347 commit a8cfe95
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cli/installer/docker_compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"gopkg.in/yaml.v3"
)

var localSystemDockerComposeCommand = "docker compose"

var dockerCompose = installer{
name: "docker-compose",
preChecks: []preChecker{
Expand Down Expand Up @@ -70,7 +72,8 @@ func dockerComposeInstaller(config configuration, ui cliUI.UI) {
dockerComposeFName := filepath.Join(dir, dockerComposeFilename)

dockerCmd := fmt.Sprintf(
"docker compose -f %s up -d",
"%s -f %s up -d",
localSystemDockerComposeCommand,
dockerComposeFName,
)

Expand Down Expand Up @@ -364,7 +367,14 @@ func dockerReadyChecker(ui cliUI.UI) {
}

func dockerComposeChecker(ui cliUI.UI) {
if commandSuccess("docker-compose") {
localSystemDockerComposeCommand = "docker-compose"
ui.Println(ui.Green("✔ docker-compose already installed"))
return
}

if commandSuccess("docker compose") {
localSystemDockerComposeCommand = "docker compose"
ui.Println(ui.Green("✔ docker compose already installed"))
return
}
Expand Down

0 comments on commit a8cfe95

Please sign in to comment.