(subcommand string)
| 277 | } |
| 278 | |
| 279 | func makeSubcommandExec(subcommand string) *exec.Cmd { |
| 280 | var execCmd *exec.Cmd |
| 281 | if runtime.GOOS == "windows" { |
| 282 | return exec.Command("powershell.exe", "-Command", subcommand) |
| 283 | } |
| 284 | |
| 285 | if _, err := os.Stat("/bin/bash"); err == nil { |
| 286 | execCmd = exec.Command("bash", "-c", subcommand) |
| 287 | } else { |
| 288 | execCmd = exec.Command("sh", "-c", subcommand) |
| 289 | } |
| 290 | |
| 291 | execCmd.SysProcAttr = getPlatformSysProcAttr() |
| 292 | |
| 293 | return execCmd |
| 294 | } |
| 295 | |
| 296 | func getTempFile() (*os.File, error) { |
| 297 | path := filepath.Join(os.TempDir(), "cronitor") |
no test coverage detected