From 19ddd9a7a48ed20dee6e0e9e570d6cd814a96823 Mon Sep 17 00:00:00 2001 From: Paul Gier Date: Wed, 27 Sep 2023 15:42:28 -0500 Subject: [PATCH] separate stderr from command output (#10) 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. --- cmd/kcloud/command.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/kcloud/command.go b/cmd/kcloud/command.go index a485277..9336615 100644 --- a/cmd/kcloud/command.go +++ b/cmd/kcloud/command.go @@ -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