From d0797ad9b7b61297a1424c86e1b4c9d24693fec4 Mon Sep 17 00:00:00 2001 From: Grzegorz Dlugoszewski Date: Tue, 30 Jun 2020 13:54:43 +0200 Subject: [PATCH] Fix showing stdout of git commands We need to capture also stderr because this is where eg, the progress of git clone is printed --- pkg/run/run.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/run/run.go b/pkg/run/run.go index 6367f31..cb3eadd 100644 --- a/pkg/run/run.go +++ b/pkg/run/run.go @@ -76,16 +76,14 @@ func (c *Cmd) AndCaptureLine() (string, error) { return lines[0], nil } -// AndShow executes the command and prints its output into standard output. +// AndShow executes the command and prints its stderr and stdout. func (c *Cmd) AndShow() error { c.cmd.Stdout = os.Stdout - - errStream := &bytes.Buffer{} - c.cmd.Stderr = errStream + c.cmd.Stderr = os.Stderr err := c.cmd.Run() if err != nil { - return &GitError{errStream, c.cmd.Args, err} + return &GitError{&bytes.Buffer{}, c.cmd.Args, err} } return nil }