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