MCPcopy Create free account
hub / github.com/remotemobprogramming/mob / executeCommandsInBackgroundProcess

Function executeCommandsInBackgroundProcess

mob.go:484–501  ·  view source on GitHub ↗
(commands ...string)

Source from the content-addressed store, hash-verified

482}
483
484func executeCommandsInBackgroundProcess(commands ...string) (err error) {
485 cmds := make([]string, 0)
486 for _, c := range commands {
487 if len(c) > 0 {
488 cmds = append(cmds, c)
489 }
490 }
491 say.Debug(fmt.Sprintf("Operating System %s", runtime.GOOS))
492 switch runtime.GOOS {
493 case "windows":
494 _, err = startCommand("powershell", "-command", fmt.Sprintf("start-process powershell -NoNewWindow -ArgumentList '-command \"%s\"'", strings.Join(cmds, ";")))
495 case "darwin", "linux":
496 _, err = startCommand("sh", "-c", fmt.Sprintf("(%s) &", strings.Join(cmds, ";")))
497 default:
498 say.Warning(fmt.Sprintf("Cannot execute background commands on your os: %s", runtime.GOOS))
499 }
500 return err
501}
502
503func currentTime() string {
504 return time.Now().Format("15:04")

Callers 3

startTimerFunction · 0.85
startBreakTimerFunction · 0.85
mooFunction · 0.85

Calls 3

DebugFunction · 0.92
WarningFunction · 0.92
startCommandFunction · 0.85

Tested by

no test coverage detected