fix: checkVersion

This commit is contained in:
手瓜一十雪 2024-03-20 12:03:25 +08:00
parent 7cafbdfae5
commit d5a3687f2b

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 };
} }
} }