Skip to content

Commit

Permalink
fix: init Command for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
debugtalk committed Jan 18, 2024
1 parent 5c07c89 commit e695403
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions myexec/cmd_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"os/exec"
"path/filepath"
"strconv"
"strings"
"syscall"

"github.com/pkg/errors"
Expand Down Expand Up @@ -91,11 +90,8 @@ func ensurePython3Venv(venvDir string, packages ...string) (python3 string, err
}

func Command(name string, arg ...string) *exec.Cmd {
// "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
cmd := exec.Command("cmd.exe")
cmd := exec.Command(name, arg...)
cmd.SysProcAttr = &syscall.SysProcAttr{
CmdLine: strings.Join(append([]string{"/c", name}, arg...), " "),
HideWindow: true,
}
return cmd
Expand Down

0 comments on commit e695403

Please sign in to comment.