mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +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)
|
||||
|
||||
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) }
|
||||
|
||||
@@ -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) }
|
||||
|
||||
Reference in New Issue
Block a user