(shell string, command string, dir string)
| 199 | } |
| 200 | |
| 201 | func makeCommand(shell string, command string, dir string) (*exec.Cmd, error) { |
| 202 | shcmd, err := CheckShell(shell) |
| 203 | if err != nil { |
| 204 | return nil, err |
| 205 | } |
| 206 | var cmd *exec.Cmd |
| 207 | switch shell { |
| 208 | case "bash", "sh": |
| 209 | cmd = exec.Command(shcmd, "-c", command) |
| 210 | case "modd": |
| 211 | cmd = exec.Command(shcmd, "--exec", command) |
| 212 | case "powershell": |
| 213 | cmd = exec.Command(shcmd, "-Command", command) |
| 214 | } |
| 215 | cmd.Dir = dir |
| 216 | prepCmd(cmd) |
| 217 | return cmd, nil |
| 218 | } |
no test coverage detected
searching dependent graphs…