Skip to content

Commit

Permalink
fix: Improovment check outdated version
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Jul 12, 2024
1 parent f3cc84b commit 1f0a9da
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/tools/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1f0a9da

Please sign in to comment.