mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 15:17:25 +00:00
Don't mangle release candidate version numbers
This commit is contained in:
parent
f1e3b979a7
commit
9c099f1337
@ -772,7 +772,7 @@ func ensureDir(dir string, mode int) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var vRe = regexp.MustCompile(`^(v\d+\.\d+\.\d+(?:-[a-z]\w+)?)[+\.-]`)
|
var plusRe = regexp.MustCompile(`\+.*$`)
|
||||||
|
|
||||||
// transformVersion returns a version number formatted correctly, with all
|
// transformVersion returns a version number formatted correctly, with all
|
||||||
// development versions aggregated into one.
|
// development versions aggregated into one.
|
||||||
@ -783,9 +783,7 @@ func transformVersion(v string) string {
|
|||||||
if !strings.HasPrefix(v, "v") {
|
if !strings.HasPrefix(v, "v") {
|
||||||
v = "v" + v
|
v = "v" + v
|
||||||
}
|
}
|
||||||
if m := vRe.FindStringSubmatch(v); len(m) > 0 {
|
v = plusRe.ReplaceAllString(v, " (+dev)")
|
||||||
return m[1] + " (+dev)"
|
|
||||||
}
|
|
||||||
|
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user