mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Update all code styles
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
--luacheck:ignore global require
|
||||
-- luacheck:ignore global require
|
||||
|
||||
local package = require("modules/exp_util/include/package")
|
||||
local loaded = package.loaded
|
||||
@@ -6,18 +6,18 @@ local _require = require
|
||||
|
||||
-- This replace function is used to avoid additional lines in stack traces during control stage
|
||||
local function replace()
|
||||
require = function(path)
|
||||
if package.lifecycle == package.lifecycle_stage.runtime then
|
||||
return loaded[path] or loaded[path:gsub(".", "/")] or error('Can only require files at runtime that have been required in the control stage.', 2)
|
||||
else
|
||||
return _require(path)
|
||||
end
|
||||
end
|
||||
require = function(path)
|
||||
if package.lifecycle == package.lifecycle_stage.runtime then
|
||||
return loaded[path] or loaded[path:gsub(".", "/")] or error("Can only require files at runtime that have been required in the control stage.", 2)
|
||||
else
|
||||
return _require(path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return setmetatable({
|
||||
on_init = replace,
|
||||
on_load = replace,
|
||||
}, {
|
||||
__call = _require
|
||||
__call = _require,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user