Skip to content

Commit

Permalink
fix: do not print extraneous newlines when executionInfo output is hi…
Browse files Browse the repository at this point in the history
…dden (#519)

Co-authored-by: Valentin Kiselev <mrexox@evilmartians.com>
  • Loading branch information
hyperupcall and mrexox authored Jul 18, 2023
1 parent 9f47c64 commit e227a43
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/lefthook/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,19 +478,21 @@ func (r *Runner) logExecute(name string, err error, out io.Reader) {
var execLog string
switch {
case r.SkipSettings.SkipExecutionInfo():
execLog = "\n"
execLog = ""
case err != nil:
execLog = fmt.Sprint(log.Red("\n EXECUTE > "), log.Bold(name))
default:
execLog = fmt.Sprint(log.Cyan("\n EXECUTE > "), log.Bold(name))
}

if err == nil && r.SkipSettings.SkipExecutionOutput() {
if execLog != "" {
log.Info(execLog)
}

if err == nil && r.SkipSettings.SkipExecutionOutput() {
return
}

log.Info(execLog)
if out != nil {
log.Info(out)
}
Expand Down

0 comments on commit e227a43

Please sign in to comment.