mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-06 15:03:54 +08:00
Merge PR #6280
fix(update): strip hyphenated pre-release/custom suffix in version comparison
This commit is contained in:
@@ -655,6 +655,9 @@ func compareVersions(current, latest string) int {
|
||||
|
||||
func parseVersion(v string) [3]int {
|
||||
v = strings.TrimPrefix(v, "v")
|
||||
if idx := strings.IndexByte(v, '-'); idx != -1 {
|
||||
v = v[:idx]
|
||||
}
|
||||
parts := strings.Split(v, ".")
|
||||
result := [3]int{0, 0, 0}
|
||||
for i := 0; i < len(parts) && i < 3; i++ {
|
||||
|
||||
Reference in New Issue
Block a user