grafana/pkg/build/git.go
Kevin Minehart d913e46e37
Chore: move build command to importable package (#38726)
* move build command to importable package & clean up
2021-09-03 11:24:21 -05:00

18 lines
313 B
Go

package build
func getGitBranch() string {
v, err := runError("git", "rev-parse", "--abbrev-ref", "HEAD")
if err != nil {
return "main"
}
return string(v)
}
func getGitSha() string {
v, err := runError("git", "rev-parse", "--short", "HEAD")
if err != nil {
return "unknown-dev"
}
return string(v)
}