Skip to content

Commit 8cd24ca

Browse files
committed
Reroute Execute fns to new ExecuteEnvWithIO
1 parent 31119da commit 8cd24ca

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

sdks/go/pkg/beam/util/execx/exec.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,13 @@ import (
2525
// Execute runs the program with the given arguments. It attaches stdio to the
2626
// child process.
2727
func Execute(prog string, args ...string) error {
28-
return ExecuteEnv(nil, prog, args...)
28+
return ExecuteEnvWithIO(nil, os.Stdin, os.Stdout, os.Stderr, prog, args...)
2929
}
3030

3131
// ExecuteEnv runs the program with the given arguments with additional environment
3232
// variables. It attaches stdio to the child process.
3333
func ExecuteEnv(env map[string]string, prog string, args ...string) error {
34-
cmd := exec.Command(prog, args...)
35-
cmd.Stdin = os.Stdin
36-
cmd.Stdout = os.Stdout
37-
cmd.Stderr = os.Stderr
38-
if env != nil {
39-
cmd.Env = os.Environ()
40-
for k, v := range env {
41-
cmd.Env = append(cmd.Env, k+"="+v)
42-
}
43-
}
44-
45-
return cmd.Run()
34+
return ExecuteEnvWithIO(env, os.Stdin, os.Stdout, os.Stderr, prog, args...)
4635
}
4736

4837
// ExecuteEnvWithIO runs the program with the given arguments with additional environment

0 commit comments

Comments
 (0)