Commit 442ef0bd authored by Matthias Schiffer's avatar Matthias Schiffer

check_site_lib: add need_boolean check

parent 851bbe69
......@@ -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)
......
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