Skip to content

Commit

Permalink
🐛 Fix bootstrap execution
Browse files Browse the repository at this point in the history
  • Loading branch information
tiulpin committed Feb 20, 2024
1 parent 78769ad commit 5099c43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions platform/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
}
Expand Down

0 comments on commit 5099c43

Please sign in to comment.