Chore: move build command to importable package (#38726)

* move build command to importable package & clean up
This commit is contained in:
Kevin Minehart
2021-09-03 11:24:21 -05:00
committed by GitHub
parent 68c7d054bf
commit d913e46e37
8 changed files with 602 additions and 464 deletions
+17
View File
@@ -0,0 +1,17 @@
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)
}