-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Line 28 in e7ab2d0
| func RunLocal(c CmdObject) (r ReturnInfo) { |
func RunLocal(workDir string, bin string, args ...string) (r ReturnMessage) {
cmd := exec.Command(bin, args...)
if workDir != "" {
cmd.Dir = workDir
}
combinedOutput, err := cmd.CombinedOutput()
if cmd.ProcessState == nil {
r.Code = -1
r.Info = err.Error()
} else {
if exitCode, ok := cmd.ProcessState.Sys().(syscall.WaitStatus); ok {
r.Code = exitCode.ExitStatus()
} else {
r.Code = -2
}
r.Info = string(combinedOutput)
}
log.Printf("%q\n%+v\n", cmd.Args, r)
return
}
Metadata
Metadata
Assignees
Labels
No labels