| Index: go/util/command.go
|
| diff --git a/go/util/command.go b/go/util/command.go
|
| index f1494ad1d891b28b85d970851c1599102f553426..48db07892cc9688d8860fd01ff5df53467ff42f0 100644
|
| --- a/go/util/command.go
|
| +++ b/go/util/command.go
|
| @@ -1,31 +1,12 @@
|
| package util
|
|
|
| import (
|
| - "os/exec"
|
| - "strings"
|
| -
|
| - "github.com/skia-dev/glog"
|
| + "go.skia.org/infra/go/exec"
|
| )
|
|
|
| // DoCmd executes the given command line string; the command being
|
| // run is expected to not care what its current working directory is.
|
| -// Returns the stdout and stderr. If there is an error, the
|
| -// returned error will be of type ExitError, which the caller
|
| -// can use to find out more about what happened.
|
| +// Returns the stdout and stderr.
|
| func DoCmd(commandLine string) (string, error) {
|
| - glog.Infof("Command: %q\n", commandLine)
|
| - programAndArgs := strings.SplitN(commandLine, " ", 2)
|
| - program := programAndArgs[0]
|
| - args := []string{}
|
| - if len(programAndArgs) > 1 {
|
| - args = strings.Split(programAndArgs[1], " ")
|
| - }
|
| - cmd := exec.Command(program, args...)
|
| - message, err := cmd.CombinedOutput()
|
| - glog.Infof("StdOut + StdErr: %s\n", string(message))
|
| - if err != nil {
|
| - glog.Errorf("Exit status: %s\n", err)
|
| - return string(message), err
|
| - }
|
| - return string(message), nil
|
| + return exec.RunSimple(commandLine)
|
| }
|
|
|