mirror of
https://github.com/go-task/task.git
synced 2025-03-17 21:08:01 +02:00
21 lines
341 B
Go
21 lines
341 B
Go
// +build windows
|
|
|
|
package execext
|
|
|
|
import (
|
|
"os/exec"
|
|
)
|
|
|
|
// NewCommand returns a new command that runs on "sh" is available or on "cmd"
|
|
// otherwise on Windows
|
|
func NewCommand(c string) *exec.Cmd {
|
|
if ShExists {
|
|
return newShCommand(c)
|
|
}
|
|
return newCmdCommand(c)
|
|
}
|
|
|
|
func newCmdCommand(c string) {
|
|
return exec.Command("cmd", "/C", c)
|
|
}
|