From 5099c439d198118fbfd742e68791a43bde74227c Mon Sep 17 00:00:00 2001 From: tiulpin Date: Tue, 20 Feb 2024 01:53:07 +0100 Subject: [PATCH] :bug: Fix `bootstrap` execution --- core/core_test.go | 2 +- platform/env.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/core_test.go b/core/core_test.go index 150f836b..73492f96 100644 --- a/core/core_test.go +++ b/core/core_test.go @@ -456,7 +456,7 @@ func Test_Bootstrap(t *testing.T) { t.Fatal(err) } opts.ProjectDir = tmpDir - platform.Bootstrap("echo \"bootstrap: touch qodana.yml\" > qodana.yaml", opts.ProjectDir) + platform.Bootstrap("echo 'bootstrap: touch qodana.yml' > qodana.yaml", opts.ProjectDir) config := platform.GetQodanaYaml(tmpDir) platform.Bootstrap(config.Bootstrap, opts.ProjectDir) if _, err := os.Stat(filepath.Join(opts.ProjectDir, "qodana.yaml")); errors.Is(err, os.ErrNotExist) { diff --git a/platform/env.go b/platform/env.go index d8cbefa9..e185ad62 100644 --- a/platform/env.go +++ b/platform/env.go @@ -123,7 +123,6 @@ func validateJobUrl(ciUrl string, qEnv string) string { // Bootstrap takes the given command (from CLI or qodana.yaml) and runs it. func Bootstrap(command string, project string) { if command != "" { - log.Printf("Running %s...", command) var executor string var flag string switch runtime.GOOS { @@ -135,7 +134,7 @@ func Bootstrap(command string, project string) { flag = "-c" } - if res, err := RunCmd(project, executor, flag, command); res > 0 || err != nil { + if res, err := RunCmd(project, executor, flag, "\""+command+"\""); res > 0 || err != nil { log.Printf("Provided bootstrap command finished with error: %d. Exiting...", res) os.Exit(res) }