Skip to content

Commit

Permalink
feat: always log stdout from command
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhelfand committed Sep 6, 2023
1 parent 447cf20 commit e948eca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/generic/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ func RunCommand(command string, args, successOrFail string) error {
cmdStr := toRun.String()
log.Infof("Running command: %s", cmdStr)
err := toRun.Run()
log.Infof("Logging stdout from command: %s", stdout.String())

if successOrFail == "succeeds" && err != nil {
return fmt.Errorf("command '%s' did not succeed. error: '%v'. stderr: '%s'", cmdStr, err, stderr.String())
}
Expand Down

0 comments on commit e948eca

Please sign in to comment.