Run is a wrapper over os/exec Cmd.Run that configures Stderr/Stdin/Stdout to the current ones and wait until the process finishes, exiting with the same code. Run will also forward all the signals sent to step to the command.
(name string, arg ...string)
| 54 | // same code. Run will also forward all the signals sent to step to the |
| 55 | // command. |
| 56 | func Run(name string, arg ...string) { |
| 57 | cmd, exitCh, err := run(name, arg...) |
| 58 | if err != nil { |
| 59 | errorAndExit(name, err) |
| 60 | } |
| 61 | |
| 62 | if err = cmd.Wait(); err != nil { |
| 63 | errorf(name, err) |
| 64 | } |
| 65 | |
| 66 | // exit and wait until os.Exit |
| 67 | exitCh <- getExitStatus(cmd) |
| 68 | exitCh <- 0 |
| 69 | } |
| 70 | |
| 71 | // RunWithPid calls Run and writes the process ID in pidFile. |
| 72 | func RunWithPid(pidFile, name string, arg ...string) { |
no test coverage detected