(commands ...string)
| 482 | } |
| 483 | |
| 484 | func 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 | |
| 503 | func currentTime() string { |
| 504 | return time.Now().Format("15:04") |
no test coverage detected