summaryrefslogtreecommitdiffhomepage
path: root/core
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-05-08 20:52:20 +0000
committerSteven Barth <steven@midlink.org>2008-05-08 20:52:20 +0000
commitf547a274f7c1ab03ad7463c227146b4683e9be27 (patch)
tree8d38a95d0cfcdb48a2820675eff534493f1bb99e /core
parent9a5184324c34fcccd728de910f6fa22b970c4374 (diff)
* Minor bugfixes
Diffstat (limited to 'core')
-rw-r--r--core/src/fs.lua12
-rw-r--r--core/src/menu.lua13
2 files changed, 8 insertions, 17 deletions
diff --git a/core/src/fs.lua b/core/src/fs.lua
index 0ca191be9..4639ac4a8 100644
--- a/core/src/fs.lua
+++ b/core/src/fs.lua
@@ -29,9 +29,7 @@ module("ffluci.fs", package.seeall)
require("posix")
-- Glob
-function glob(pattern)
- return posix.glob(pattern)
-end
+glob = posix.glob
-- Checks whether a file exists
function isfile(filename)
@@ -79,13 +77,7 @@ basename = posix.basename
dirname = posix.dirname
-- dir wrapper
-function dir(path)
- local dir = {}
- for node in posix.files(path) do
- table.insert(dir, 1, node)
- end
- return dir
-end
+dir = posix.dir
-- Alias for posix.mkdir
mkdir = posix.mkdir
diff --git a/core/src/menu.lua b/core/src/menu.lua
index 5724b2cb9..d6f65116e 100644
--- a/core/src/menu.lua
+++ b/core/src/menu.lua
@@ -30,7 +30,7 @@ require("ffluci.util")
require("ffluci.sys")
-- Default modelpath
-modelpath = ffluci.sys.libpath() .. "/model/menu/"
+modelpattern = ffluci.sys.libpath() .. "/model/menu/*.lua"
-- Menu definition extra scope
scope = {
@@ -100,12 +100,11 @@ end
function collect()
local generators = {}
- for k, menu in pairs(ffluci.fs.dir(modelpath)) do
- if menu:sub(1, 1) ~= "." then
- local f = loadfile(modelpath.."/"..menu)
- if f then
- table.insert(generators, f)
- end
+ local m = ffluci.fs.glob(modelpattern) or {}
+ for k, menu in pairs(m) do
+ local f = loadfile(menu)
+ if f then
+ table.insert(generators, f)
end
end