reorder
parent
ef76eff228
commit
69ad2a961c
13
file.go
13
file.go
|
@ -86,12 +86,15 @@ func (f *File) Do(CmdTimeout time.Duration) (string, error) {
|
|||
}
|
||||
f.owner.log.Info("DO: ", f.Cmd)
|
||||
done := make(chan string, 1)
|
||||
var b bytes.Buffer
|
||||
cmd.Stdout = &b
|
||||
cmd.Stderr = &b
|
||||
err := cmd.Start()
|
||||
if err != nil {
|
||||
f.owner.log.Error("cmd start error: ", err)
|
||||
panic(err)
|
||||
}
|
||||
go func() {
|
||||
|
||||
var b bytes.Buffer
|
||||
cmd.Stdout = &b
|
||||
cmd.Stderr = &b
|
||||
cmd.Start()
|
||||
f.pid = cmd.Process.Pid
|
||||
cmd.Wait()
|
||||
done <- b.String()
|
||||
|
|
Loading…
Reference in New Issue