浏览代码

Update loader;

bjorn 7 年之前
父节点
当前提交
5913fc0f82
共有 2 个文件被更改,包括 107 次插入1250 次删除
  1. 106 1244
      api/init.lua
  2. 1 6
      api/main.lua

文件差异内容过多而无法显示
+ 106 - 1244
api/init.lua


+ 1 - 6
api/main.lua

@@ -1,10 +1,5 @@
 local serpent = require 'serpent'
 
--- Make sure init.lua can be required
-if not package.path:match('%./?/init%.lua') then
-  package.path = package.path .. ';./?/init.lua'
-end
-
 -- Helpers
 local function copy(t)
   if type(t) ~= 'table' then return t end
@@ -193,7 +188,7 @@ local function processObject(path, parent)
 end
 
 local function processModule(path)
-  local module = require(path .. '.init')
+  local module = require(path .. '.init') -- So we avoid requiring the module itself
 
   module.key = module.external and path:match('[^/]+$') or path:gsub('/', '.')
   module.name = module.external and module.key or module.key:match('[^%.]+$')

部分文件因为文件数量过多而无法显示