Skip to content

Commit afaae20

Browse files
committed
fix: ignore pre-release suffixes in version comparison
1 parent abbe171 commit afaae20

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

app.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ func (a *App) checkForUpdate() {
9898
}
9999

100100
func isNewerVersion(latest, current string) bool {
101+
if idx := strings.Index(latest, "-"); idx >= 0 {
102+
latest = latest[:idx]
103+
}
104+
if idx := strings.Index(current, "-"); idx >= 0 {
105+
current = current[:idx]
106+
}
101107
ls := strings.Split(latest, ".")
102108
cs := strings.Split(current, ".")
103109
max := len(ls)

0 commit comments

Comments
 (0)