RunCommand runs a command on the host system. returns the stdout of the command and an err
(command string, args []string)
| 55 | // RunCommand runs a command on the host system. |
| 56 | // returns the stdout of the command and an err |
| 57 | func RunCommand(command string, args []string) (string, error) { |
| 58 | out, err := HostCommand( |
| 59 | command, args..., |
| 60 | ).CombinedOutput() |
| 61 | |
| 62 | output.UserOut.WithFields(output.Fields{ |
| 63 | "Result": string(out), |
| 64 | }).Debug("Command ") |
| 65 | |
| 66 | return string(out), err |
| 67 | } |
| 68 | |
| 69 | // RunCommandPipe runs a command on the host system |
| 70 | // Returns combined output as string, and error |