1
0
mirror of https://github.com/zyedidia/micro synced 2024-06-29 05:54:24 +00:00

tools/build-version.go: Remove the git fetch step

build-version.go shall only provide information and not modify the repository
in which it runs.
This commit is contained in:
Jöran Karl 2024-06-20 22:32:05 +02:00
parent f5a9744bde
commit d98fafd2f9

View File

@ -38,24 +38,6 @@ func getTag(match ...string) (string, *semver.PRVersion) {
}
func main() {
tags, err := exec.Command("git", "tag").Output()
if err != nil {
log.Println("git tag:", err)
if e, ok := err.(*exec.ExitError); ok {
log.Print(string(e.Stderr))
}
}
if len(tags) == 0 {
// no tags found -- fetch them
err = exec.Command("git", "fetch", "--tags").Run()
if err != nil {
log.Println("git fetch --tags:", err)
if e, ok := err.(*exec.ExitError); ok {
log.Print(string(e.Stderr))
}
}
}
// Find the last vX.X.X Tag and get how many builds we are ahead of it.
versionStr, ahead := getTag("--match", "v*")
version, err := semver.ParseTolerant(versionStr)