mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
fix(version): match major versions with multiple digits (#259)
This commit is contained in:
@@ -4,7 +4,7 @@ function lib.versionCheck(repository)
|
|||||||
local currentVersion = GetResourceMetadata(resource, 'version', 0)
|
local currentVersion = GetResourceMetadata(resource, 'version', 0)
|
||||||
|
|
||||||
if currentVersion then
|
if currentVersion then
|
||||||
currentVersion = currentVersion:match('%d%.%d+%.%d+')
|
currentVersion = currentVersion:match('%d+%.%d+%.%d+')
|
||||||
end
|
end
|
||||||
|
|
||||||
if not currentVersion then return print(("^1Unable to determine current resource version for '%s' ^0"):format(resource)) 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)
|
response = json.decode(response)
|
||||||
if response.prerelease then return end
|
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
|
if not latestVersion or latestVersion == currentVersion then return end
|
||||||
|
|
||||||
local cv = { string.strsplit('.', currentVersion) }
|
local cv = { string.strsplit('.', currentVersion) }
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
function lib.checkDependency(resource, minimumVersion, printMessage)
|
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
|
if currentVersion ~= minimumVersion then
|
||||||
local cv = { string.strsplit('.', currentVersion) }
|
local cv = { string.strsplit('.', currentVersion) }
|
||||||
|
|||||||
Reference in New Issue
Block a user