shellCommand returns the platform shell invocation for a command string.
(command string)
| 56 | |
| 57 | // shellCommand returns the platform shell invocation for a command string. |
| 58 | func shellCommand(command string) (string, []string) { |
| 59 | if runtime.GOOS == "windows" { |
| 60 | return "cmd", []string{"/C", command} |
| 61 | } |
| 62 | return "/bin/sh", []string{"-c", command} |
| 63 | } |
| 64 | |
| 65 | // Install installs the tool by executing its install_cmd through the shell. |
| 66 | func Install(tool Tool, runner CommandRunner, stdout, stderr io.Writer) (int, error) { |