exclude current version from updates
Massimo Melina committed
Jul 19, 2023 at 12:55 UTC
1af18405bd6646f3da5f5fa1011c957fa83bf5c8
1 file changed
+4
-3
src/update.ts
+4
-3
@@ -18,7 +18,7 @@ interface Release { prerelease: boolean, tag_name: string, name: string, assets:
18
19
export async function getUpdates() {
20
const stable: Release = await getRepoInfo(HFS_REPO + '/releases/latest')
21
- const minVer = Math.max(ver(stable), currentVersion.getScalar())
21
+ const verStable = ver(stable)
22
const ret = await getBetas()
23
if (stable && currentVersion.olderThan(stable.tag_name))
24
ret.unshift(stable)
@@ -38,9 +38,10 @@ export async function getUpdates() {
38
if (!res.length) break
39
for (const x of res) {
40
if (!x.prerelease) continue // prerelease are all the end
41
- if (ver(x) <= minVer) // prerelease-s are locally ordered, so as soon as we reach verStable we are done
41
+ if (ver(x) <= verStable) // prerelease-s are locally ordered, so as soon as we reach verStable we are done
42
return ret
43
- ret.push(x)
43
+ if (ver(x) !== currentVersion.getScalar())
44
+ ret.push(x)
45
}
46
}
47
return ret