mirror of
https://github.com/peco/peco.git
synced 2026-09-10 07:16:29 -04:00
20 lines
320 B
Go
20 lines
320 B
Go
//go:build !windows
|
|
// +build !windows
|
|
|
|
package util
|
|
|
|
import "os/exec"
|
|
|
|
func Shell(cmd ...string) *exec.Cmd {
|
|
const shellpath = `/bin/sh`
|
|
const shellopt = `-c`
|
|
|
|
args := make([]string, len(cmd)+1)
|
|
args[0] = shellopt
|
|
for i := 0; i < len(cmd); i++ {
|
|
args[i+1] = cmd[i]
|
|
}
|
|
|
|
return exec.Command(shellpath, args...)
|
|
}
|