Skip to content

Commit

Permalink
Check for contents in Stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
valendesigns committed Feb 28, 2019
1 parent 3d8ba39 commit bc71cec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion process/phpcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (cs *Phpcs) Do() error {
cmdArgs = append(cmdArgs, "-q")

// Prepare the command and set the stdOut pipe.
resultBytes, _, exitCode, err := phpcsRunner.Run(cmdName, cmdArgs...)
_, resultBytes, exitCode, err := phpcsRunner.Run(cmdName, cmdArgs...)

log.Log(cs.Message.Title, fmt.Sprintf("phpcs output:\n %s", strings.TrimSpace(string(resultBytes))))

Expand Down
4 changes: 2 additions & 2 deletions shell/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ func (c *Command) Run(name string, arg ...string) ([]byte, []byte, int, error) {
}
})

var resultsBuffer bytes.Buffer
var errorsBuffer bytes.Buffer
resultsBuffer := bytes.Buffer{}
errorsBuffer := bytes.Buffer{}
cmd := c.execFunc(name, arg...)
cmd.Stdout = &resultsBuffer
cmd.Stderr = &errorsBuffer
Expand Down

0 comments on commit bc71cec

Please sign in to comment.