1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

chore: added more logs to git

refs #529
This commit is contained in:
Carlos Alexandro Becker 2018-01-27 15:50:44 -02:00
parent 41a09ea45a
commit 8d37d45288
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -5,6 +5,8 @@ import (
"errors"
"os/exec"
"strings"
"github.com/apex/log"
)
// IsRepo returns true if current folder is a git repository
@ -17,10 +19,12 @@ func IsRepo() bool {
func Run(args ...string) (output string, err error) {
/* #nosec */
var cmd = exec.Command("git", args...)
log.WithField("args", args).Debug("running git")
bts, err := cmd.CombinedOutput()
if err != nil {
return "", errors.New(string(bts))
}
log.WithField("output", string(bts)).Debug("result")
return string(bts), err
}