From dbb1b9b6d51bf498a26d3748070da4cc4220818e Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Wed, 4 Dec 2013 11:57:18 -0800 Subject: [PATCH] fix jsonmessage Upstream-commit: 4bc100b494022901d4d7f51cba303ae3562b1303 Component: engine --- components/engine/utils/jsonmessage.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/engine/utils/jsonmessage.go b/components/engine/utils/jsonmessage.go index eaa90a5b64..c36ec27763 100644 --- a/components/engine/utils/jsonmessage.go +++ b/components/engine/utils/jsonmessage.go @@ -38,11 +38,11 @@ func (p *JSONProgress) String() string { width = int(ws.Width) } - if p.Current == 0 && p.Total == 0 { + if p.Current <= 0 && p.Total <= 0 { return "" } current := HumanSize(int64(p.Current)) - if p.Total == 0 { + if p.Total <= 0 { return fmt.Sprintf("%8v", current) } total := HumanSize(int64(p.Total)) @@ -126,7 +126,7 @@ func DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr, if jm.Progress != nil { jm.Progress.terminalFd = terminalFd } - if (jm.Progress != nil || jm.ProgressMessage != "") && jm.ID != "" { + if jm.Progress != nil || jm.ProgressMessage != "" { line, ok := ids[jm.ID] if !ok { line = len(ids)