Skip to content

Commit

Permalink
fix: Do not print extra newlines if execution_info output is hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall committed Jul 14, 2023
1 parent 27aca37 commit c972c23
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/lefthook/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,14 +478,16 @@ 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))
}

log.Info(execLog)
if execLog != "" {
log.Info(execLog)
}

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

0 comments on commit c972c23

Please sign in to comment.