ReadOutput for process, and --wait will read process output

This commit is contained in:
Jae Kwon
2015-04-17 10:27:17 -07:00
parent 02bc535e0e
commit 75697034bd
4 changed files with 22 additions and 1 deletions

View File

@@ -176,17 +176,23 @@ func RunProcess(wait bool, label string, execPath string, args []string, input s
if wait {
<-proc.WaitCh
output := pcm.ReadOutput(proc)
if proc.ExitState == nil {
return &ResponseRunProcess{
Success: true,
Output: output,
}, nil
} else {
return &ResponseRunProcess{
Success: proc.ExitState.Success(), // Would be always false?
Output: output,
}, nil
}
} else {
return &ResponseRunProcess{}, nil
return &ResponseRunProcess{
Success: true,
Output: "",
}, nil
}
}