refactor(init): export cache and update intervals

BREAKING CHANGE: lib will store cached export functions and no longer uses the : syntax to call functions.

Allow SetInterval to return arguments to the callback function.
This commit is contained in:
Linden
2021-12-27 11:10:05 +11:00
parent 6b3af6f0d9
commit d0c5f722db
4 changed files with 65 additions and 45 deletions

View File

@@ -5,10 +5,9 @@ CreateThread(function()
local version = GetResourceMetadata(resource, 'version', 0)
PerformHttpRequest(('%s/master/fxmanifest.lua'):format(url:gsub('github.com', 'raw.githubusercontent.com')), function(error, response)
if error ~= 200 then
if error == 200 then
local latest = response:match('%d%.%d+%.%d+')
print(version, latest)
if version == latest then
if version < latest then
local curMajor, curMinor = string.strsplit('.', version)
local newMajor, newMinor = string.strsplit('.', response:match('%d%.%d+%.%d+'))
local link = ('%s/archive/refs/tags/%s.zip'):format(url, latest, latest)