Skip to content

Commit

Permalink
Revert "Fix execution of command with quotes on windows." (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
knqyf263 committed Jan 25, 2024
1 parent 4c51204 commit ac91ac6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"os/exec"
"runtime"
"strings"
"syscall"

"github.com/fatih/color"
"github.com/knqyf263/pet/config"
Expand All @@ -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)
}
Expand Down

0 comments on commit ac91ac6

Please sign in to comment.