mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-10 03:47:03 +02:00
bf9f0e0b14
This reverts commit 36efad3f78
.
22 lines
433 B
Go
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
|
|
}
|