From 68028f1f4e2848f39e4562c898691e5529cbf5dc Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Thu, 9 May 2024 10:55:53 +1000 Subject: [PATCH] fix(update): incorrect regex patterns --- src/update/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/update/index.ts b/src/update/index.ts index ca2d7b7..45d2d1c 100644 --- a/src/update/index.ts +++ b/src/update/index.ts @@ -4,9 +4,9 @@ import fetch from 'node-fetch'; if (GetConvarInt('mysql_versioncheck', 1) === 0) return; const resourceName = GetCurrentResourceName(); - const currentVersion = GetResourceMetadata(resourceName, 'version', 0)?.match(/(\d)\.(\d)\.(\d)/); + const currentVersion = GetResourceMetadata(resourceName, 'version', 0)?.match(/(\d+)\.(\d+)\.(\d+)/); - if (!currentVersion) return console.log(`^1Unable to determine current resource version for '${resourceName}'^0`); + if (!currentVersion) return; setTimeout(async () => { const response = await fetch(`https://api.github.com/repos/overextended/oxmysql/releases/latest`); @@ -15,7 +15,7 @@ import fetch from 'node-fetch'; const release = (await response.json()) as any; if (release.prerelease) return; - const latestVersion = release.tag_name.match(/(\d)\.(\d)\.(\d)/); + const latestVersion = release.tag_name.match(/(\d+)\.(\d+)\.(\d+)/); if (!latestVersion || latestVersion[0] === currentVersion[0]) return; for (let i = 1; i < currentVersion.length; i++) {