Skip to content
Snippets Groups Projects
Unverified Commit 8cb03884 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

scripts/check_site.lua: enable in_site()/in_domain() checks

parent 146787fa
No related branches found
No related tags found
No related merge requests found
...@@ -63,19 +63,6 @@ local function merge(a, b) ...@@ -63,19 +63,6 @@ local function merge(a, b)
end end
function in_site(var)
return var
end
function in_domain(var)
return var
end
function this_domain()
return domain_code
end
local function path_to_string(path) local function path_to_string(path)
return table.concat(path, '/') return table.concat(path, '/')
end end
...@@ -118,6 +105,27 @@ local function var_error(path, val, msg) ...@@ -118,6 +105,27 @@ local function var_error(path, val, msg)
end end
function in_site(path)
if has_domains and loadpath(nil, domain, unpack(path)) ~= nil then
exit_error(domain_src(), '%s is allowed in site configuration only', path_to_string(path))
end
return path
end
function in_domain(path)
if has_domains and loadpath(nil, site, unpack(path)) ~= nil then
exit_error(site_src(), '%s is allowed in domain configuration only', path_to_string(path))
end
return path
end
function this_domain()
return domain_code
end
function extend(path, c) function extend(path, c)
if not path then return nil end if not path then return nil end
......
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