This commit is contained in:
josc146 2023-06-07 16:49:31 +08:00
parent 796338a32f
commit dae3f72d04

View File

@ -25,11 +25,13 @@ func Cmd(args ...string) (string, error) {
return "", err
}
if strings.Contains(cmdHelper, " ") {
for _, arg := range args {
if strings.Contains(arg, " ") && strings.Contains(cmdHelper, " ") {
if strings.Contains(arg, " ") {
return "", errors.New("path contains space") // golang bug https://github.com/golang/go/issues/17149#issuecomment-473976818
}
}
}
cmd := exec.Command(cmdHelper, args...)
out, err := cmd.CombinedOutput()