Esempio n. 1
0
func GetRepoName() string {
	out, err := pipeline.Output(
		[]string{"git", "config", "--get", "buranko.reponame"},
	)

	if err != nil {
		return ""
	}

	return strings.TrimRight(string(out), "\n")
}
Esempio n. 2
0
// TODO: Should move to git.go?
func GetBranchNameFromGitCommand() string {
	out, err := pipeline.Output(
		[]string{"git", "rev-parse", "--abbrev-ref", "HEAD"},
	)

	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	return string(out)
}