-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
summon no longer buffers wrapped process stdout output [CONJ-4705] (#64)
* wip * Dont wrap 'Convey' calls with stdout wrapper, introduces unwanted chars * Ensure that err is nil in TestRunSubcommand test * Bump version and changelog in prep for 0.6.6 release * fix error message and assertion * defer restoring stdout to ensure it happens always
- Loading branch information
1 parent
0732640
commit 1973af0
Showing
5 changed files
with
83 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
package command | ||
|
||
import ( | ||
"bytes" | ||
"io" | ||
"os" | ||
"os/exec" | ||
) | ||
|
||
// runSubcommand executes a command with arguments in the context | ||
// of an environment populated with secret values. | ||
func runSubcommand(command []string, env []string) (string, error) { | ||
var stdOut bytes.Buffer | ||
|
||
func runSubcommand(command []string, env []string) error { | ||
runner := exec.Command(command[0], command[1:]...) | ||
runner.Stdin = os.Stdin | ||
runner.Stdout = io.MultiWriter(os.Stdout, &stdOut) | ||
runner.Stdout = os.Stdout | ||
runner.Stderr = os.Stderr | ||
runner.Env = env | ||
|
||
err := runner.Run() | ||
return stdOut.String(), err | ||
return runner.Run() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package main | ||
|
||
const VERSION = "0.6.5" | ||
const VERSION = "0.6.6" |