fix: failed to exec command line on windows

This commit is contained in:
xucong053
2022-09-30 13:27:24 +08:00
parent a43b95add6
commit 7a553f31b6
3 changed files with 15 additions and 4 deletions
+5
View File
@@ -69,6 +69,11 @@ func ensurePython3Venv(venv string, packages ...string) (python3 string, err err
return python3, nil
}
func Command(name string, arg ...string) *exec.Cmd {
args := strings.Join(arg, " ")
return exec.Command("bash", "-c", name, args)
}
func ExecCommand(cmdName string, args ...string) error {
cmd := exec.Command(cmdName, args...)
log.Info().Str("cmd", cmd.String()).Msg("exec command")