mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-24 15:38:27 +00:00
Version handling for v0.9+
This commit is contained in:
parent
0080ee6e86
commit
b37b19f344
5
main.go
5
main.go
@ -337,11 +337,14 @@ func ensureDir(dir string, mode int) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var vRe = regexp.MustCompile(`^(v\d+\.\d+\.\d+)-.+`)
|
var vRe = regexp.MustCompile(`^(v\d+\.\d+\.\d+(?:-[a-z]\w+)?)[+\.-]`)
|
||||||
|
|
||||||
// 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.
|
||||||
func transformVersion(v string) string {
|
func transformVersion(v string) string {
|
||||||
|
if v == "unknown-dev" {
|
||||||
|
return v
|
||||||
|
}
|
||||||
if !strings.HasPrefix(v, "v") {
|
if !strings.HasPrefix(v, "v") {
|
||||||
v = "v" + v
|
v = "v" + v
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user