Skip to content

Commit

Permalink
fix a bug where the cli was swallowing stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonskie committed Apr 25, 2023
1 parent 14f2f76 commit b386086
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion terraform/cli.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package terraform

import (
"fmt"
"io"
"os"
"os/exec"
Expand Down Expand Up @@ -38,5 +39,10 @@ func (c CLI) RunWithEnv(stdout io.Writer, workingDirectory string, args []string
command.Stdout = io.MultiWriter(stdout, c.outputBuffer)
command.Stderr = c.errorBuffer

return command.Run()
err = command.Run()
if err != nil {
return fmt.Errorf("command execution failed got: %s stderr:\n %s", err, c.errorBuffer)
}

return nil
}

0 comments on commit b386086

Please sign in to comment.