1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-06 03:13:48 +02:00

fix: show git error on debug

This commit is contained in:
Carlos Alexandro Becker 2018-07-03 23:41:36 -07:00
parent 6a06f76c49
commit 9d4be131cf
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -25,10 +25,13 @@ func Run(args ...string) (string, error) {
var stderr bytes.Buffer
cmd.Stdout = &stdout
cmd.Stderr = &stderr
if err := cmd.Run(); err != nil {
err := cmd.Run()
log.WithField("stdout", stdout.String()).
WithField("stderr", stderr.String()).
Debug("git result")
if err != nil {
return "", errors.New(stderr.String())
}
log.WithField("output", stdout.String()).Debug("git result")
return stdout.String(), nil
}