feat(imports/require): custom require for script files

This commit is contained in:
Linden
2023-02-22 09:50:44 +11:00
parent 47b8a72527
commit 7ab2aac9be
2 changed files with 69 additions and 1 deletions

View File

@@ -23,7 +23,8 @@ if status ~= true then error(status, 2) end
local LoadResourceFile = LoadResourceFile
local context = IsDuplicityVersion() and 'server' or 'client'
local function noop() end
function noop() end
local function loadModule(self, module)
local dir = ('imports/%s'):format(module)
@@ -86,6 +87,9 @@ lib = setmetatable({
__call = call,
})
-- Override standard Lua require with our own.
require = lib.require
local intervals = {}
--- Dream of a world where this PR gets accepted.
---@param callback function | number