simplify local modules loading

This commit is contained in:
MihailRis 2024-11-20 07:49:21 +03:00
parent eb9a89ed96
commit 02578a6276

View File

@ -292,6 +292,10 @@ function __load_script(path, nocache)
end
function require(path)
if not string.find(path, ':') then
local prefix, _ = parse_path(debug.getinfo(2).source)
return require(prefix..':'..path)
end
local prefix, file = parse_path(path)
return __load_script(prefix..":modules/"..file..".lua")
end