diff --git a/init.lua b/init.lua index be69f72..53c8515 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,3 @@ -package.path = 'etc/?.lua;etc/?/init.lua;' .. package.path +package.path = 'etc/?.lua;etc/?/init.lua;?.lua;?/init.lua;' .. package.path require 'src.parts.core' diff --git a/src/parts/core.lua b/src/parts/core.lua index 8e072a8..b616a4d 100644 --- a/src/parts/core.lua +++ b/src/parts/core.lua @@ -1,4 +1,4 @@ -local config = require 'config' +local config = require 'config' local Core = { config = config, @@ -14,8 +14,9 @@ function Core:load(what) print(('Loading %s (%d / %d) %s...'):format(what:sub(0, -2), i, s, v)) -- Lint - if pcall(require, 'src.'.. what ..'.'.. v) then - local a=require('src.'.. what ..'.'.. v) + local e, a = pcall(require, 'src.'.. what ..'.'.. v) + print(e, a) + if e then if what == 'events' then self.api:on(v, a) elseif what == 'cmds' then self.cmds[v] = a elseif what == 'parts' then a(self) diff --git a/start.sh b/start.sh index dd7d2e5..e8c615f 100755 --- a/start.sh +++ b/start.sh @@ -1,3 +1,3 @@ #!/bin/sh cd $(dirname $0) -lua5.3 init.lua +luajit init.lua || lua5.3 init.lua