refactor(init): call imports and exports via lib

Deprecate import (now just references lib); when calling or indexing
lib for the first time, attempt to load a module else call an export.
This commit is contained in:
Linden
2022-02-28 02:40:25 +00:00
parent 37032fe0dd
commit e83aa653cc
4 changed files with 41 additions and 40 deletions

View File

@@ -14,8 +14,6 @@ function lib.versionCheck(repository)
local latestVersion = response.tag_name:match('%d%.%d+%.%d+')
if not latestVersion then return end
print(currentVersion, latestVersion)
if currentVersion >= latestVersion then return end
print(('^3An update is available for %s (current version: %s)\r\n%s^0'):format(resource, currentVersion, response.html_url))
@@ -23,14 +21,4 @@ function lib.versionCheck(repository)
end)
end
function lib.checkDependency(resource, minimumVersion)
local currentVersion = GetResourceMetadata(resource, 'version', 0):match('%d%.%d+%.%d+')
if currentVersion < minimumVersion then
return print(("^1%s requires version '%s' of '%s' (current version: %s)^0"):format(GetInvokingResource() or GetCurrentResourceName(), minimumVersion, resource, currentVersion))
end
return true
end
lib.versionCheck('overextended/ox_lib')

View File

@@ -0,0 +1,9 @@
function lib.checkDependency(resource, minimumVersion)
local currentVersion = GetResourceMetadata(resource, 'version', 0):match('%d%.%d+%.%d+')
if currentVersion < minimumVersion then
return print(("^1%s requires version '%s' of '%s' (current version: %s)^0"):format(GetInvokingResource() or GetCurrentResourceName(), minimumVersion, resource, currentVersion))
end
return true
end