mirror of
https://github.com/mickael-menu/zk
synced 2024-11-07 15:20:21 +00:00
19 lines
356 B
Go
19 lines
356 B
Go
package exec
|
|
|
|
import (
|
|
"fmt"
|
|
"os/exec"
|
|
"syscall"
|
|
)
|
|
|
|
// CommandFromString returns a Cmd running the given command.
|
|
func CommandFromString(command string) *exec.Cmd {
|
|
cmd := exec.Command("cmd")
|
|
cmd.SysProcAttr = &syscall.SysProcAttr{
|
|
HideWindow: false,
|
|
CmdLine: fmt.Sprintf(` /v:on/s/c "%s"`, command),
|
|
CreationFlags: 0,
|
|
}
|
|
return cmd
|
|
}
|