mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix errors
This commit is contained in:
parent
f1dd299227
commit
01e98bf0dd
2 changed files with 5 additions and 3 deletions
|
@ -1536,7 +1536,7 @@ func (cli *DockerCli) stream(method, path string, in io.Reader, out io.Writer) e
|
|||
}
|
||||
|
||||
if resp.Header.Get("Content-Type") == "application/json" {
|
||||
utils.DisplayJSONMessagesStream(resp.Body, out)
|
||||
return utils.DisplayJSONMessagesStream(resp.Body, out)
|
||||
} else {
|
||||
if _, err := io.Copy(out, resp.Body); err != nil {
|
||||
return err
|
||||
|
|
|
@ -658,12 +658,14 @@ func DisplayJSONMessagesStream(in io.Reader, out io.Writer) error {
|
|||
}
|
||||
fmt.Fprintf(out, "%c[%dA", 27, diff)
|
||||
}
|
||||
jm.Display(out)
|
||||
err := jm.Display(out)
|
||||
if jm.ID != "" {
|
||||
fmt.Fprintf(out, "%c[%dB", 27, diff)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// fmt.Fprintf(out, "\n")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue