Dont duplicate release versions in prereleases

This commit is contained in:
Matt Keeler 2018-06-20 15:44:19 -04:00
parent c361a23d42
commit 74fe2fae8b
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 != "" {
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)
}