From b3602f2e3d03d8c73a973ac73d071fabcb5390f2 Mon Sep 17 00:00:00 2001 From: Sebastian Choren <sebastian.choren@gmail.com> Date: Mon, 9 Oct 2023 18:00:01 -0300 Subject: [PATCH] fix(cli): check for docker-compose on installer --- cli/installer/docker_compose.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cli/installer/docker_compose.go b/cli/installer/docker_compose.go index 9417489b6a..fe7a3c052e 100644 --- a/cli/installer/docker_compose.go +++ b/cli/installer/docker_compose.go @@ -18,6 +18,8 @@ import ( "gopkg.in/yaml.v3" ) +var localSystemDockerComposeCommand = "docker compose" + var dockerCompose = installer{ name: "docker-compose", preChecks: []preChecker{ @@ -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, ) @@ -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 }