Merge pull request #734 from crosbymichael/hook-error

Report hook output on error
This commit is contained in:
Mrunal Patel 2016-04-08 14:34:58 -07:00
commit 278cc30557
1 changed files with 5 additions and 1 deletions

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 {