fix(releaseupdate): a development build names no release to compare
This commit is contained in:
2 files changed
+8
-2
No files matched your search
@@ -193,9 +193,14 @@ func installable(r githubRelease) string {
|
||||
}
|
||||
|
||||
// ReleaseVersion is the release a build was cut from: a git-describe build
|
||||
// ("1.55.0-218-gabc123") is the same release as its tag.
|
||||
// ("1.55.0-218-gabc123") is the same release as its tag. A build that names no
|
||||
// release ("dev") has none, so nothing can be judged newer than it.
|
||||
func ReleaseVersion(version string) string {
|
||||
return buildSuffix.ReplaceAllString(version, "")
|
||||
version = buildSuffix.ReplaceAllString(version, "")
|
||||
if !semver.IsValid("v" + strings.TrimPrefix(version, "v")) {
|
||||
return ""
|
||||
}
|
||||
return version
|
||||
}
|
||||
|
||||
// installedAgent is the image the installer last switched to, recorded in a
|
||||
|
||||
Reference in new issue
Block a user