mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-25 18:07:07 +09:00
Set version as release when there are no commits ahead (#3515)
Print release version tag in tools/build-version.go even if the commit being checked has a tag that is not a version number if there are no commits ahead.
This commit is contained in:
@@ -47,15 +47,16 @@ func main() {
|
|||||||
fmt.Println("0.0.0-unknown")
|
fmt.Println("0.0.0-unknown")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Get the tag of the current revision.
|
if ahead == nil {
|
||||||
tag, _ := getTag("--exact-match")
|
|
||||||
if tag == versionStr {
|
|
||||||
// Seems that we are going to build a release.
|
// Seems that we are going to build a release.
|
||||||
// So the version number should already be correct.
|
// So the version number should already be correct.
|
||||||
fmt.Println(version.String())
|
fmt.Println(version.String())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the tag of the current revision.
|
||||||
|
tag, _ := getTag("--exact-match")
|
||||||
|
|
||||||
// If we don't have any tag assume "dev"
|
// If we don't have any tag assume "dev"
|
||||||
if tag == "" || strings.HasPrefix(tag, "nightly") {
|
if tag == "" || strings.HasPrefix(tag, "nightly") {
|
||||||
tag = "dev"
|
tag = "dev"
|
||||||
@@ -72,10 +73,8 @@ func main() {
|
|||||||
log.Printf("semver.NewPRVersion(%s): %v", tag, err)
|
log.Printf("semver.NewPRVersion(%s): %v", tag, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ahead != nil {
|
// append how many commits we are ahead of the last release
|
||||||
// if we know how many commits we are ahead of the last release, append that too.
|
version.Pre = append(version.Pre, *ahead)
|
||||||
version.Pre = append(version.Pre, *ahead)
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Println(version.String())
|
fmt.Println(version.String())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user