Run runs the command and waits for it to exit. It is a convenience function that combines both Start() and Wait().
()
| 69 | // Run runs the command and waits for it to exit. It is a convenience |
| 70 | // function that combines both Start() and Wait(). |
| 71 | func (d *Process) Run() <-chan error { |
| 72 | err := d.Start() |
| 73 | if err != nil { |
| 74 | ch := make(chan error, 1) |
| 75 | ch <- err |
| 76 | return ch |
| 77 | } |
| 78 | |
| 79 | return d.Wait() |
| 80 | } |
| 81 | |
| 82 | // Restart kill the running process and reruns the command with the updated |
| 83 | // cmd and args. |