Skip to content

Commit

Permalink
separate stderr from command output (#10)
Browse files Browse the repository at this point in the history
If a command results in output to stderr, that output should be printed for the user
instead of trying to parse it because it may not follow the same format as the
standard command output.
  • Loading branch information
pgier authored Sep 27, 2023
1 parent 7ad3570 commit 19ddd9a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/kcloud/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ func RunCommand(command string, args ...string) ([]byte, error) {
fmt.Println("debug: ", QuoteCommand(command, args...))
}
cmd := exec.Command(command, args...)
return cmd.CombinedOutput()
cmd.Stderr = os.Stderr
return cmd.Output()
}

// QuoteCommand writes the given command with quotes around the args for convenience
Expand Down

0 comments on commit 19ddd9a

Please sign in to comment.