diff options
Diffstat (limited to 'platform.lua')
-rw-r--r-- | platform.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/platform.lua b/platform.lua index 6c9d7c09..eb318a84 100644 --- a/platform.lua +++ b/platform.lua @@ -41,3 +41,18 @@ else package.path = rootPath .. script .. '/?.lua' .. ';' .. rootPath .. script .. '/?/init.lua' end + +package.searchers[2] = function (name) + local filename, err = package.searchpath(name, package.path) + if not filename then + return err + end + local f = io.open(filename) + local buf = f:read '*a' + f:close() + local init, err = load(buf, '@' .. name) + if not init then + return err + end + return init, filename +end |