Skip to content

Commit

Permalink
When script fails with exit code 1 we want to see the reson in logs
Browse files Browse the repository at this point in the history
Use case: problem in covnersion script when script exited with 1 but we had to manually reproduce the situation to see which part of code was problematic

Signed-off-by: Andrea Waltlova <[email protected]>
  • Loading branch information
andywaltlova committed Dec 1, 2023
1 parent ed055ae commit b891f61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ func processSignedScript(incomingContent []byte) string {
cmd := exec.Command(yamlContent.Vars.Interpreter, scriptFileName) //nolint:gosec
setEnvVariablesForCommand(cmd, yamlContent.Vars.ContentVars)

out, err := cmd.Output()
out, err := cmd.CombinedOutput()
if err != nil {
log.Errorln("Failed to execute script: ", err)
log.Errorln(out)
return ""
}

Expand Down

0 comments on commit b891f61

Please sign in to comment.