fix(version): match major versions with multiple digits (#259)

This commit is contained in:
David Malchin
2023-03-01 19:30:26 +02:00
committed by GitHub
parent ad2c50cd1d
commit 9c1c784e5d
2 changed files with 3 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ function lib.versionCheck(repository)
local currentVersion = GetResourceMetadata(resource, 'version', 0)
if currentVersion then
currentVersion = currentVersion:match('%d%.%d+%.%d+')
currentVersion = currentVersion:match('%d+%.%d+%.%d+')
end
if not currentVersion then return print(("^1Unable to determine current resource version for '%s' ^0"):format(resource)) end
@@ -16,7 +16,7 @@ function lib.versionCheck(repository)
response = json.decode(response)
if response.prerelease then return end
local latestVersion = response.tag_name:match('%d%.%d+%.%d+')
local latestVersion = response.tag_name:match('%d+%.%d+%.%d+')
if not latestVersion or latestVersion == currentVersion then return end
local cv = { string.strsplit('.', currentVersion) }

View File

@@ -1,5 +1,5 @@
function lib.checkDependency(resource, minimumVersion, printMessage)
local currentVersion = GetResourceMetadata(resource, 'version', 0):match('%d%.%d+%.%d+')
local currentVersion = GetResourceMetadata(resource, 'version', 0):match('%d+%.%d+%.%d+')
if currentVersion ~= minimumVersion then
local cv = { string.strsplit('.', currentVersion) }