Skip to content

Commit

Permalink
tasklog: use helper method to determine if file is a TTY
Browse files Browse the repository at this point in the history
We already have a helper method to determine if a file is a TTY. In a
future commit, we'll modify the definition of what constitutes a TTY, so
refactor the code to always use the helper method so that we need only
update one place.
  • Loading branch information
bk2204 committed Mar 28, 2019
1 parent a5e6104 commit f244fa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasklog/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func (l *Logger) logTask(task Task) {

var update *Update
for update = range task.Updates() {
if !isatty.IsTerminal(os.Stdout.Fd()) && !l.forceProgress {
if !tty(os.Stdout) && !l.forceProgress {
continue
}
if logAll || l.throttle == 0 || !update.Throttled(last.Add(l.throttle)) {
Expand Down

0 comments on commit f244fa9

Please sign in to comment.