-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.lua
42 lines (33 loc) · 954 Bytes
/
bootstrap.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
local args = { ... }
return (function()
local modules
local package --= _G.package
if package == nil then
package = {}
end
if package.loaded == nil then
package.loaded = {}
end
if package.loaders == nil then
package.loaders = {}
end
local require -- = require
if require == nil then
require = function(module)
if not package.loaded[module] then
if not modules[module] then
error('Failed loading module "' + module + '"')
end
package.loaded[module] = modules[module]() or true
end
return package.loaded[module]
end
else
table.insert(package.loaders, function(module) return modules[module] end)
end
modules = {
bootstrapArgs = function() return args end,
[==[MODULES]==]
}
return require('[==[ENTRY_POINT]==]')
end)()