From ae6d10ec830328e4b81becf42fed340291b0dea7 Mon Sep 17 00:00:00 2001 From: Rafal Piekarski Date: Tue, 23 Mar 2021 13:16:25 +0100 Subject: [PATCH] fix: drop bash dependency to run verification hooks in favor of plain shell --- internal/hooks/local_hook.go | 2 +- internal/verification/run.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/hooks/local_hook.go b/internal/hooks/local_hook.go index b024cf5..f3a18f8 100644 --- a/internal/hooks/local_hook.go +++ b/internal/hooks/local_hook.go @@ -12,7 +12,7 @@ type LocalHook struct { func (l *LocalHook) Run(path string) error { cmd := templateString(path, l.Command) fmt.Printf("> %s\n", cmd) - out, err := exec.Command("bash", "-c", cmd).CombinedOutput() + out, err := exec.Command("sh", "-c", cmd).CombinedOutput() if err != nil { return err } diff --git a/internal/verification/run.go b/internal/verification/run.go index 5bb60db..c174452 100644 --- a/internal/verification/run.go +++ b/internal/verification/run.go @@ -42,7 +42,7 @@ func Run(cmdToRun, pathsArg, s3VersionID, gitBranchName string, cmd, pullCmd, su cmdToRun = strings.ReplaceAll(cmdToRun, pathPattern, filename) fmt.Printf("Executing command: `%s`\n\n", cmdToRun) - runCmd := exec.Command("bash", "-c", cmdToRun) + runCmd := exec.Command("sh", "-c", cmdToRun) runCmd.Stdout = os.Stdout runCmd.Stderr = os.Stderr runErr := runCmd.Run()