Skip to content

Commit

Permalink
Only print CR if live-updating
Browse files Browse the repository at this point in the history
  • Loading branch information
timdp committed Apr 28, 2018
1 parent 422d8ad commit 245ebc2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/app/lwc/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ func ProcessFile(namePtr *string, processors []Processor, totals *[]uint64, inte
}

// Update stdout at fixed intervals, but only if it's a terminal
live := lwcutil.StdoutIsTTY()
var done chan bool
if lwcutil.StdoutIsTTY() {
if live {
done = make(chan bool)
// Write zeroes straightaway in case file is empty
PrintCounts(&counts, name, false, false)
Expand All @@ -86,7 +87,7 @@ func ProcessFile(namePtr *string, processors []Processor, totals *[]uint64, inte
}

// Write final counts
PrintCounts(&counts, name, true, true)
PrintCounts(&counts, name, live, true)
}

func ProcessFiles(config *Config) {
Expand Down

0 comments on commit 245ebc2

Please sign in to comment.