From 3b13fb9a49a3fe89060ce497c12f489eb2b852d3 Mon Sep 17 00:00:00 2001 From: rogdevil Date: Wed, 25 Oct 2023 21:42:41 +0530 Subject: [PATCH] fix so that commands with && > | these operator work --- pkg/synthesize.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/synthesize.go b/pkg/synthesize.go index 4e82899..82e71c8 100644 --- a/pkg/synthesize.go +++ b/pkg/synthesize.go @@ -6,7 +6,6 @@ import ( "os" "os/exec" "path/filepath" - "strings" "github.com/flosch/pongo2/v6" "github.com/go-git/go-git/v5/plumbing/transport/ssh" @@ -103,8 +102,7 @@ func SynthesizePipelineConfigurationFile(pipeline Pipeline, outDir string) (stri func runCommands(workdir string, commands []string) error { var err error for _, instr := range commands { - cag := strings.Split(instr, " ") - cmd := exec.Command(cag[0], cag[1:]...) + cmd := exec.Command("bash", "-c", instr) cmd.Dir = workdir if err = cmd.Run(); err != nil { return fmt.Errorf("error running command '%s': %w", instr, err)