Skip to content

Commit

Permalink
fix: fix for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed Sep 20, 2024
1 parent 1064edc commit 0fc15a8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/lefthook/runner/exec/execute_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ func (e CommandExecutor) Execute(ctx context.Context, opts Options, in io.Reader
return nil
}

func (e CommandExecutor) execute(cmdstr string, args *executeArgs) error {
cmdargs := strings.Split(cmdstr, " ")
command := exec.Command(cmdargs[0])
func (e CommandExecutor) execute(cmd []string, args *executeArgs) error {
command := exec.Command(cmd[0])
command.SysProcAttr = &syscall.SysProcAttr{
CmdLine: strings.Join(cmdargs, " "),
CmdLine: strings.Join(cmd, " "),
}
command.Dir = args.root
command.Env = append(os.Environ(), args.envs...)
Expand Down

0 comments on commit 0fc15a8

Please sign in to comment.