aboutsummaryrefslogtreecommitdiff
path: root/utils/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'utils/utils.go')
-rw-r--r--utils/utils.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/utils.go b/utils/utils.go
index 9b7cebfea..c7c5ab5cf 100644
--- a/utils/utils.go
+++ b/utils/utils.go
@@ -29,11 +29,14 @@ func ExecCmd(name string, args ...string) (string, error) {
}
// ExecCmdWithStdStreams execute a command with the specified standard streams.
-func ExecCmdWithStdStreams(stdin io.Reader, stdout, stderr io.Writer, name string, args ...string) error {
+func ExecCmdWithStdStreams(stdin io.Reader, stdout, stderr io.Writer, env []string, name string, args ...string) error {
cmd := exec.Command(name, args...)
cmd.Stdin = stdin
cmd.Stdout = stdout
cmd.Stderr = stderr
+ if env != nil {
+ cmd.Env = env
+ }
err := cmd.Run()
if err != nil {