This commit is contained in:
Gvidas Juknevičius 2024-08-18 03:43:01 +03:00
parent 24947c49a7
commit c3e1cd0438
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB
2 changed files with 10 additions and 2 deletions

View File

@ -1,7 +1,11 @@
local __BUNDLER_FILES = {}
local __DEFAULT_IMPORT = require
local require = function(path)
return __BUNDLER_FILES[path]() or __DEFAULT_IMPORT(path)
if __BUNDLER_FILES[path] then
return __BUNDLER_FILES[path]()
else
__DEFAULT_IMPORT(path)
end
end
__BUNDLER_FILES["updater.lua"] = function ()

6
x.py
View File

@ -25,7 +25,11 @@ def main():
buf += "local __BUNDLER_FILES = {}\n";
buf += "local __DEFAULT_IMPORT = require\n";
buf += "local require = function(path)\n";
buf += " return __BUNDLER_FILES[path]() or __DEFAULT_IMPORT(path)\n";
buf += " if __BUNDLER_FILES[path] then\n";
buf += " return __BUNDLER_FILES[path]()\n";
buf += " else\n";
buf += " __DEFAULT_IMPORT(path)\n";
buf += " end\n";
buf += "end\n";
for file in FILES: