Bläddra i källkod

Update loader;

bjorn 6 år sedan
förälder
incheckning
99047d67ed
2 ändrade filer med 300 tillägg och 1156 borttagningar
  1. 299 1150
      api/init.lua
  2. 1 6
      api/main.lua

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 299 - 1150
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
@@ -181,7 +176,7 @@ local function processObject(path, parent)
 end
 
 local function processModule(path)
-  local module = require(path)
+  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('[^%.]+$')

Vissa filer visades inte eftersom för många filer har ändrats