Skip to content

Commit

Permalink
chore: remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed May 30, 2024
1 parent 0dad2a2 commit 57ffe23
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 21 deletions.
10 changes: 0 additions & 10 deletions internal/lefthook/runner/exec/execute_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ func (e CommandExecutor) Execute(ctx context.Context, opts Options, in io.Reader
return nil
}

// func (e CommandExecutor) RawExecute(ctx context.Context, command []string, in io.Reader, out io.Writer) error {
// cmd := exec.CommandContext(ctx, command[0], command[1:]...)

// cmd.Stdin = in
// cmd.Stdout = out
// cmd.Stderr = os.Stderr

// return cmd.Run()
// }

func (e CommandExecutor) execute(ctx context.Context, cmdstr string, args *executeArgs) error {
command := exec.CommandContext(ctx, "sh", "-c", cmdstr)
command.Dir = args.root
Expand Down
10 changes: 0 additions & 10 deletions internal/lefthook/runner/exec/execute_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ func (e CommandExecutor) Execute(ctx context.Context, opts Options, in io.Reader
return nil
}

// func (e CommandExecutor) RawExecute(ctx context.Context, command []string, in io.Reader, out io.Writer) error {
// cmd := exec.CommandContext(ctx, command[0], command[1:]...)

// cmd.Stdin = in
// cmd.Stdout = out
// cmd.Stderr = os.Stderr

// return cmd.Run()
// }

func (e CommandExecutor) execute(cmdstr string, args *executeArgs) error {
cmdargs := strings.Split(cmdstr, " ")
command := exec.Command(cmdargs[0])
Expand Down
2 changes: 1 addition & 1 deletion internal/lefthook/runner/exec/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ type Options struct {
// Executor provides an interface for command execution.
// It is used here for testing purpose mostly.
type Executor interface {
Execute(ctx context.Context, opts Options, in io.Reader, out io.Writer) error
Execute(context.Context, Options, io.Reader, io.Writer) error
}

0 comments on commit 57ffe23

Please sign in to comment.