Merge pull request #143 from LLOneBot/fix-update

Fix: update
This commit is contained in:
linyuchen 2024-03-20 12:24:17 +08:00 committed by GitHub
commit 7966bf75c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,9 +12,9 @@ export async function checkVersion() {
const latestVersionText = await getRemoteVersion(); const latestVersionText = await getRemoteVersion();
const latestVersion = latestVersionText.split("."); const latestVersion = latestVersionText.split(".");
log("llonebot last version", latestVersion); log("llonebot last version", latestVersion);
const currentVersion = version.split("."); const currentVersion: string[] = version.split(".");
for (let k in [0, 1, 2]) { for (let k of [0, 1, 2]) {
if (latestVersion[k] > currentVersion[k]) { if (parseInt(latestVersion[k]) > parseInt(currentVersion[k])) {
return { result: false, version: latestVersionText }; return { result: false, version: latestVersionText };
} }
} }