Report hook output on error

Fixes #733

This reports the stdout/err for a hook if it returns a non-zero exit
status.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2016-04-08 11:02:44 -07:00
parent 865f4a685d
commit bee8cb5fbb
+5 -1
View File
@@ -307,7 +307,11 @@ func (c Command) Run(s HookState) error {
}
errC := make(chan error, 1)
go func() {
errC <- cmd.Run()
out, err := cmd.CombinedOutput()
if err != nil {
err = fmt.Errorf("%s: %s", err, out)
}
errC <- err
}()
if c.Timeout != nil {
select {