Skip to content

Commit

Permalink
fix: allow skipping execution_out with interactive mode (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed Apr 28, 2023
1 parent b2ce7b6 commit fda2a29
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion internal/lefthook/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"errors"
"fmt"
"io"
"os"
"path/filepath"
"regexp"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit fda2a29

Please sign in to comment.