Loosen the requirements on what can be upgraded to what

This commit is contained in:
Jakob Borg 2015-04-21 09:06:10 +09:00
parent e2420495f3
commit 08c383012f

View File

@ -78,10 +78,15 @@ func init() {
} }
} }
// Check for a clean release build. // Check for a clean release build. A release is something like "v0.1.2",
exp := regexp.MustCompile(`^v\d+\.\d+\.\d+(-beta[\d\.]+)?$`) // with an optional suffix of letters and dot separated numbers like
// "-beta3.47". If there's more stuff, like a plus sign and a commit hash
// and so on, then it's not a release. If there's a dash anywhere in
// there, it's some kind of beta or prerelease version.
exp := regexp.MustCompile(`^v\d+\.\d+\.\d+(-[a-z]+[\d\.]+)?$`)
IsRelease = exp.MatchString(Version) IsRelease = exp.MatchString(Version)
IsBeta = strings.Contains(Version, "beta") IsBeta = strings.Contains(Version, "-")
stamp, _ := strconv.Atoi(BuildStamp) stamp, _ := strconv.Atoi(BuildStamp)
BuildDate = time.Unix(int64(stamp), 0) BuildDate = time.Unix(int64(stamp), 0)