From ac91ac692ae4994b05d68283ab0a9408a7f5d716 Mon Sep 17 00:00:00 2001 From: Teppei Fukuda Date: Thu, 25 Jan 2024 10:52:26 +0400 Subject: [PATCH] Revert "Fix execution of command with quotes on windows." (#240) --- cmd/util.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/util.go b/cmd/util.go index ed9f0e71..61902796 100644 --- a/cmd/util.go +++ b/cmd/util.go @@ -8,7 +8,6 @@ import ( "os/exec" "runtime" "strings" - "syscall" "github.com/fatih/color" "github.com/knqyf263/pet/config" @@ -27,8 +26,7 @@ func run(command string, r io.Reader, w io.Writer) error { line := append(config.Conf.General.Cmd, command) cmd = exec.Command(line[0], line[1:]...) } else if runtime.GOOS == "windows" { - cmd = exec.Command("cmd.exe") - cmd.SysProcAttr = &syscall.SysProcAttr{CmdLine: fmt.Sprintf("/c \"%s\"", command)} + cmd = exec.Command("cmd", "/c", command) } else { cmd = exec.Command("sh", "-c", command) }