mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-19 18:28:33 +00:00
fix(version): report unknown versions during checkDependency
Rather than throwing potentially fatal and confusing errors we should just report the current version as 'unknown'.
This commit is contained in:
1 parent
7816ce7a33
commit
1f76590b53
1 file changed
+3
-2
@@ -1,5 +1,6 @@
|
||||
function lib.checkDependency(resource, minimumVersion, printMessage)
|
||||
local currentVersion = GetResourceMetadata(resource, 'version', 0):match('%d+%.%d+%.%d+')
|
||||
local currentVersion = GetResourceMetadata(resource, 'version', 0)
|
||||
currentVersion = currentVersion and currentVersion:match('%d+%.%d+%.%d+') or 'unknown'
|
||||
|
||||
if currentVersion ~= minimumVersion then
|
||||
local cv = { string.strsplit('.', currentVersion) }
|
||||
@@ -10,7 +11,7 @@ function lib.checkDependency(resource, minimumVersion, printMessage)
|
||||
local current, minimum = tonumber(cv[i]), tonumber(mv[i])
|
||||
|
||||
if current ~= minimum then
|
||||
if current < minimum then
|
||||
if not current or current < minimum then
|
||||
if printMessage then
|
||||
return print(msg)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user