You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/agent/util_windows.go

31 lines
580 B

// +build windows
package agent
import (
"os"
"os/exec"
"strings"
"syscall"
)
// ExecScript returns a command to execute a script through a shell.
func ExecScript(script string) (*exec.Cmd, error) {
shell := "cmd"
if other := os.Getenv("SHELL"); other != "" {
shell = other
}
script = "\"" + script + "\""
cmd := exec.Command(shell, "/C", script)
cmd.SysProcAttr = &syscall.SysProcAttr{
CmdLine: strings.Join(cmd.Args, " "),
}
return cmd, nil
}
func SetSysProcAttr(cmd *exec.Cmd) {}
func KillCommandSubtree(cmd *exec.Cmd) error {
return cmd.Process.Kill()
}