1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

disable progressbar in non-terminal

This commit is contained in:
Victor Vieux 2013-12-06 13:56:09 -08:00 committed by Guillaume J. Charmes
parent 0969be5ddb
commit f28445254f

View file

@ -89,6 +89,8 @@ func (jm *JSONMessage) Display(out io.Writer, isTerminal bool) error {
// <ESC>[2K = erase entire current line
fmt.Fprintf(out, "%c[2K\r", 27)
endl = "\r"
} else if jm.Progress != nil { //disable progressbar in non-terminal
return nil
}
if jm.Time != 0 {
fmt.Fprintf(out, "[%s] ", time.Unix(jm.Time, 0))