diff --git a/internal/lefthook/runner/runner.go b/internal/lefthook/runner/runner.go index 23ad7dbb..06c7209f 100644 --- a/internal/lefthook/runner/runner.go +++ b/internal/lefthook/runner/runner.go @@ -4,6 +4,7 @@ import ( "bytes" "errors" "fmt" + "io" "os" "path/filepath" "regexp" @@ -402,12 +403,21 @@ func (r *Runner) run(opts ExecuteOptions, follow bool) bool { if (follow || opts.interactive) && !r.SkipSettings.SkipExecution() { log.Info(log.Cyan("\n EXECUTE > "), log.Bold(opts.name)) - err := r.executor.Execute(opts, os.Stdout) + + var out io.Writer + if r.SkipSettings.SkipExecutionOutput() { + out = io.Discard + } else { + out = os.Stdout + } + + err := r.executor.Execute(opts, out) if err != nil { r.fail(opts.name, opts.failText) } else { r.success(opts.name) } + return err == nil }