1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/pipeline/git/exec.go
Carlos Alexandro Becker bf9f0e0b14
Revert "avoid cd-ing in tests"
This reverts commit 36efad3f78.
2017-04-15 14:00:49 -03:00

22 lines
433 B
Go

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
}