}
func main() {
+ if tags, err := exec.Command("git", "tag").Output(); err != nil || len(tags) == 0 {
+ // no tags found -- fetch them
+ exec.Command("git", "fetch", "--tags").Run()
+ }
// 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)
}
// If we don't have any tag assume "dev"
- if tag == "" {
+ if tag == "" || strings.HasPrefix(tag, "nightly") {
tag = "dev"
}
// Get the most likely next version: