Load only ".lua" plugin files

This commit is contained in:
yago 2014-12-16 20:06:04 +01:00
parent 8c6c781f85
commit 198f700f86

View File

@ -197,7 +197,8 @@ plugins = {}
function load_plugins() function load_plugins()
plugins = {} plugins = {}
for k, v in pairs(scandir("plugins")) do for k, v in pairs(scandir("plugins")) do
if not (v:sub(0, 1) == ".") then -- Load only lua files
if (v:match(".lua$")) then
print("Loading plugin", v) print("Loading plugin", v)
t = loadfile("plugins/" .. v)() t = loadfile("plugins/" .. v)()
table.insert(plugins, t) table.insert(plugins, t)