luci-base: dispatcher.lua: support "absent" fs dependency for menu nodes
The "absent" dependency type requires the given path to not exist on the local system for the condition to be satisified. This is useful to disable menu nodes depending on the presence of specific files. Signed-off-by: Jo-Philipp Wich <jo@mein.io> (cherry picked from commit 2e4b5fb8ff2fb3bfd1400bf7cbf721057f02fab9)
This commit is contained in:
parent
272611d74e
commit
f29452ced0
@ -39,6 +39,10 @@ local function check_fs_depends(spec)
|
||||
if fs.stat(path, "type") ~= "reg" then
|
||||
return false
|
||||
end
|
||||
elseif kind == "absent" then
|
||||
if fs.stat(path, "type") then
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user