Skip to content
Snippets Groups Projects
Commit 442ef0bd authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

check_site_lib: add need_boolean check

parent 851bbe69
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,18 @@ function need_number(varname, required)
return var
end
function need_boolean(varname, required)
local var = loadvar(varname)
if required == false and var == nil then
return nil
end
assert_type(var, 'boolean', "site.conf error: expected `" .. varname .. "' to be a boolean")
return var
end
function need_array(varname, subcheck, required)
local var = loadvar(varname)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment