Dont duplicate release versions in prereleases

This commit is contained in:
Matt Keeler 2018-06-20 15:44:19 -04:00
parent 3e8b7f3f38
commit 60ee47ea11
1 changed files with 5 additions and 1 deletions

View File

@ -35,8 +35,12 @@ func GetHumanVersion() string {
if GitDescribe == "" && release == "" {
release = "dev"
}
if release != "" {
version += fmt.Sprintf("-%s", release)
if !strings.HasSuffix(version, "-"+release) {
// if we tagged a prerelease version then the release is in the version already
version += fmt.Sprintf("-%s", release)
}
if GitCommit != "" {
version += fmt.Sprintf(" (%s)", GitCommit)
}