Skip to content

Commit

Permalink
fix: enable interactive scripts (#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed May 17, 2024
1 parent fd407ef commit e42043f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/lefthook/runner/exec/execute_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (

"github.com/creack/pty"
"github.com/mattn/go-isatty"
"github.com/mattn/go-tty"

"github.com/evilmartians/lefthook/internal/log"
)
Expand All @@ -35,10 +34,10 @@ func (e CommandExecutor) Execute(ctx context.Context, opts Options, out io.Write
in = os.Stdin
}
if opts.Interactive && !isatty.IsTerminal(os.Stdin.Fd()) {
tty, err := tty.Open()
tty, err := os.Open("/dev/tty")
if err == nil {
defer tty.Close()
in = tty.Input()
in = tty
} else {
log.Errorf("Couldn't enable TTY input: %s\n", err)
}
Expand Down

0 comments on commit e42043f

Please sign in to comment.