Commit 579e16a5 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

load modules in alphabetical order

parent b8bd8ddf
......@@ -50,13 +50,17 @@ function loadmodules(path)
local cdir = lfs.currentdir()
if path then lfs.chdir(path) end
local modules = {}
for modfile in lfs.dir((path or '/usr/share/lua/5.1')..'/awall/modules') do
if stringy.endswith(modfile, '.lua') then
local name = 'awall.modules.'..string.sub(modfile, 1, -5)
table.insert(modules, 'awall.modules.'..string.sub(modfile, 1, -5))
end
end
table.sort(modules)
for i, name in ipairs(modules) do
require(name)
readmetadata(package.loaded[name])
end
end
lfs.chdir(cdir)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment