From 1f0a9da7d841820af9fb678e9c03afc11e33fe62 Mon Sep 17 00:00:00 2001 From: icleitoncosta Date: Fri, 12 Jul 2024 20:52:50 -0300 Subject: [PATCH] fix: Improovment check outdated version --- src/tools/update.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/tools/update.ts b/src/tools/update.ts index cdd8c824..4a878d31 100644 --- a/src/tools/update.ts +++ b/src/tools/update.ts @@ -27,6 +27,7 @@ import { fetchLatest } from '../fetchLatest'; import { fetchLatestAlpha } from '../fetchLatestAlpha'; import { fetchLatestBeta } from '../fetchLatestBeta'; import { getAvailableVersions } from '../getAvailableVersions'; +import { getVersionInfo } from '../getVersionInfo'; import { getPageContent } from '../getPageContent'; /** @@ -83,8 +84,19 @@ async function checkActiveVersions() { continue; } + // Set outdated version => 2.3000.x-alpha + const info = getVersionInfo(version); + const expire = new Date(info?.expire as string); + const today = new Date(); + if (today > expire) { + process.stderr.write(`outdated\n`); + outdated.push(version); + continue; + } + const content = getPageContent(version); + // Check for versions < 2.3000.x const matches = content.match(/"hard_expire_time"\s+data-time="([\d.]+)"/); if (matches) {