Fix deprecated version check

This commit is contained in:
世界 2024-11-08 20:30:50 +08:00
parent 8df0aa5719
commit f1c76c4dde
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -24,10 +24,10 @@ func (n Note) Impending() bool {
return false return false
} }
versionMinor := semver.Compare(semver.MajorMinor("v"+C.Version), "v"+n.ScheduledVersion) versionMinor := semver.Compare(semver.MajorMinor("v"+C.Version), "v"+n.ScheduledVersion)
if versionMinor < 0 { if semver.Prerelease("v"+C.Version) == "" && versionMinor > 0 {
panic("invalid deprecated note: " + n.Name) panic("invalid deprecated note: " + n.Name)
} }
return versionMinor <= 1 return versionMinor >= -1
} }
func (n Note) Message() string { func (n Note) Message() string {