1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/pipeline/git/exec.go

22 lines
433 B
Go
Raw Normal View History

package git
import (
"errors"
"os/exec"
"strings"
)
func git(args ...string) (output string, err error) {
var cmd = exec.Command("git", args...)
bts, err := cmd.CombinedOutput()
if err != nil {
return "", errors.New(string(bts))
}
return string(bts), err
}
func cleanGit(args ...string) (output string, err error) {
output, err = git(args...)
return strings.Replace(strings.Split(output, "\n")[0], "'", "", -1), err
}