mirror of
https://github.com/go-task/task.git
synced 2026-07-02 08:58:41 +00:00
Little refactor on command creation
This commit is contained in:
22
execext/exec.go
Normal file
22
execext/exec.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user