fix package preload (for cloud-catcher)

This commit is contained in:
kepler155c@gmail.com 2019-01-12 19:51:56 -05:00
parent cb5f690cf4
commit 9edb4e7d5b
1 changed files with 7 additions and 1 deletions

View File

@ -82,8 +82,13 @@ end
-- Add require and package to the environment
return function(env)
local function standardSearcher(modname)
-- Should this be 2 diff searchers ? if yes, installer would need an update
if env.package.preload[modname] then
return function()
return env.package.preload[modname](modname, env)
end
end
if env.package.loaded[modname] then
return function()
return env.package.loaded[modname]
@ -170,6 +175,7 @@ return function(env)
path = env.LUA_PATH or _G.LUA_PATH or DEFAULT_PATH,
upath = env.LUA_UPATH or _G.LUA_UPATH or DEFAULT_UPATH,
config = '/\n:\n?\n!\n-',
preload = { },
loaded = {
coroutine = coroutine,
io = io,