mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-19 20:57:53 +02:00
parent
41a09ea45a
commit
8d37d45288
@ -5,6 +5,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/apex/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// IsRepo returns true if current folder is a git repository
|
// 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) {
|
func Run(args ...string) (output string, err error) {
|
||||||
/* #nosec */
|
/* #nosec */
|
||||||
var cmd = exec.Command("git", args...)
|
var cmd = exec.Command("git", args...)
|
||||||
|
log.WithField("args", args).Debug("running git")
|
||||||
bts, err := cmd.CombinedOutput()
|
bts, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.New(string(bts))
|
return "", errors.New(string(bts))
|
||||||
}
|
}
|
||||||
|
log.WithField("output", string(bts)).Debug("result")
|
||||||
return string(bts), err
|
return string(bts), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user