fix: failed to exec command line on windows

This commit is contained in:
xucong053
2022-09-30 13:27:24 +08:00
parent b2cac25bd4
commit 6e237429ed
3 changed files with 15 additions and 4 deletions
+5
View File
@@ -100,6 +100,11 @@ func ensurePython3Venv(venvDir string, packages ...string) (python3 string, err
return python3, nil
}
func Command(name string, arg ...string) *exec.Cmd {
args := strings.Join(arg, " ")
return exec.Command("cmd", "/c", name, args)
}
func ExecCommand(cmdName string, args ...string) error {
// "cmd /c" carries out the command specified by string and then stops
// refer: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd