Skip to content

Commit

Permalink
Redirect command stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
bouskaJ committed Apr 23, 2020
1 parent 9522fd4 commit 35c108e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,11 @@ func runScript(scriptFile, desc, namespace, baseDir string) error {

command.Dir = baseDir

if out, err := command.Output(); err == nil {
fmt.Printf("Running %s: \n%s\n", desc, out)
} else {
command.Stderr = os.Stderr
command.Stdout = os.Stdout

fmt.Printf("Running %s: \n", desc)
if err := command.Run(); err != nil {
fmt.Printf("Failed to run %s: \n%v\n", desc, err)
return err
}
Expand Down

0 comments on commit 35c108e

Please sign in to comment.