RunCommandPipe runs a command on the host system Returns combined output as string, and error
(command string, args []string)
| 69 | // RunCommandPipe runs a command on the host system |
| 70 | // Returns combined output as string, and error |
| 71 | func RunCommandPipe(command string, args []string) (string, error) { |
| 72 | output.UserOut.WithFields(output.Fields{ |
| 73 | "Command": command + " " + strings.Join(args[:], " "), |
| 74 | }).Info("Running ") |
| 75 | |
| 76 | cmd := HostCommand(command, args...) |
| 77 | stdoutStderr, err := cmd.CombinedOutput() |
| 78 | return string(stdoutStderr), err |
| 79 | } |
| 80 | |
| 81 | // RunInteractiveCommand runs a command on the host system interactively, with stdin/stdout/stderr connected |
| 82 | // Returns error |