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

Merge pull request #1551 from dotcloud/hotfix_parallel_pull_display

hot fix display in parallel pull and gofmt
This commit is contained in:
Victor Vieux 2013-08-15 04:43:26 -07:00
commit 92a2b635a3
3 changed files with 2 additions and 3 deletions

View file

@ -162,7 +162,6 @@ func (r *Registry) GetRemoteHistory(imgID, registry string, token []string) ([]s
// Check if an image exists in the Registry // Check if an image exists in the Registry
func (r *Registry) LookupRemoteImage(imgID, registry string, token []string) bool { func (r *Registry) LookupRemoteImage(imgID, registry string, token []string) bool {
req, err := r.reqFactory.NewRequest("GET", registry+"images/"+imgID+"/json", nil) req, err := r.reqFactory.NewRequest("GET", registry+"images/"+imgID+"/json", nil)
if err != nil { if err != nil {
return false return false

View file

@ -343,4 +343,4 @@ func TestWait(t *testing.T) {
<-c <-c
} }
//*/ //*/

View file

@ -645,6 +645,7 @@ func (jm *JSONMessage) Display(out io.Writer) error {
} }
return jm.Error return jm.Error
} }
fmt.Fprintf(out, "%c[2K\r", 27)
if jm.Time != 0 { if jm.Time != 0 {
fmt.Fprintf(out, "[%s] ", time.Unix(jm.Time, 0)) fmt.Fprintf(out, "[%s] ", time.Unix(jm.Time, 0))
} }
@ -655,7 +656,6 @@ func (jm *JSONMessage) Display(out io.Writer) error {
fmt.Fprintf(out, "(from %s) ", jm.From) fmt.Fprintf(out, "(from %s) ", jm.From)
} }
if jm.Progress != "" { if jm.Progress != "" {
fmt.Fprintf(out, "%c[2K", 27)
fmt.Fprintf(out, "%s %s\r", jm.Status, jm.Progress) fmt.Fprintf(out, "%s %s\r", jm.Status, jm.Progress)
} else { } else {
fmt.Fprintf(out, "%s\r\n", jm.Status) fmt.Fprintf(out, "%s\r\n", jm.Status)