From 0fc15a83c4d3dc9c999c536a0a61b91874178e91 Mon Sep 17 00:00:00 2001 From: Valentin Kiselev Date: Fri, 20 Sep 2024 13:51:59 +0300 Subject: [PATCH] fix: fix for windows --- internal/lefthook/runner/exec/execute_windows.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/lefthook/runner/exec/execute_windows.go b/internal/lefthook/runner/exec/execute_windows.go index 47d72757..a4967db5 100644 --- a/internal/lefthook/runner/exec/execute_windows.go +++ b/internal/lefthook/runner/exec/execute_windows.go @@ -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...)