mirror of
https://github.com/go-task/task.git
synced 2025-01-10 04:18:53 +02:00
23 lines
348 B
Go
23 lines
348 B
Go
package execext
|
|
|
|
import (
|
|
"os/exec"
|
|
)
|
|
|
|
var (
|
|
// ShPath is path to "sh" command
|
|
ShPath string
|
|
// ShExists is true if "sh" command is available on the system
|
|
ShExists bool
|
|
)
|
|
|
|
func init() {
|
|
var err error
|
|
ShPath, err = exec.LookPath("sh")
|
|
ShExists = err == nil
|
|
}
|
|
|
|
func newShCommand(c string) *exec.Cmd {
|
|
return exec.Command(ShPath, "-c", c)
|
|
}
|