MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / makeSubcommandExec

Function makeSubcommandExec

cmd/exec.go:279–294  ·  view source on GitHub ↗
(subcommand string)

Source from the content-addressed store, hash-verified

277}
278
279func 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
296func getTempFile() (*os.File, error) {
297 path := filepath.Join(os.TempDir(), "cronitor")

Callers 1

RunCommandFunction · 0.85

Calls 1

getPlatformSysProcAttrFunction · 0.70

Tested by

no test coverage detected