Change to CombinedOutput to consume Stderr as well #144
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First off thank you for this awesome work. It's been super easy to get the (usually) really hard stuff set up with this tool!
I did run into one issue where I thought things could be improved a bit though. One of my hooks runs a small go binary and in that binary errors are written to
os.Stderr
and when testing I noticed that it was failing with no feedback other than "exited with error code $code" which was not terribly helpful. I checked the code and noticed you were usingCmd.Output()
which only grabsos.Stdout
by default.I've submitted this pull request changing that behavior to use CombinedOutput which consumes both stderr and stdout. Hopefully that doesn't make the output too verbose but I was easily able to discover the problem in my code upon changing it and so I thought others might benefit as well.
Thank you again!