Victor Vieux 12 éve
szülő
commit
01e98bf0dd
2 módosított fájl, 5 hozzáadás és 3 törlés
  1. 1 1
      commands.go
  2. 4 2
      utils/utils.go

+ 1 - 1
commands.go

@@ -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

+ 4 - 2
utils/utils.go

@@ -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
 }