diff --git a/cmd/ipfs2/main.go b/cmd/ipfs2/main.go index b59c28f52..36dfa49cd 100644 --- a/cmd/ipfs2/main.go +++ b/cmd/ipfs2/main.go @@ -117,10 +117,13 @@ func main() { os.Exit(1) } - _, err = io.Copy(os.Stdout, res) + out, err := res.Reader() if err != nil { fmt.Println(err.Error()) + return } + + io.Copy(os.Stdout, out) } func getOptions(req cmds.Request, root *cmds.Command) (cmds.Request, error) {