aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/configmanager.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/configmanager.lua b/core/configmanager.lua
index 951f61fd..9a66ad13 100644
--- a/core/configmanager.lua
+++ b/core/configmanager.lua
@@ -62,6 +62,16 @@ local function set(config_table, host, key, value)
return false;
end
+local function rawget_option(config_table, host, key)
+ if host and key then
+ local hostconfig = rawget(config_table, host);
+ if not hostconfig then
+ return nil;
+ end
+ return rawget(hostconfig, key);
+ end
+end
+
function _M.set(host, key, value)
return set(config, host, key, value);
end
@@ -119,6 +129,10 @@ do
if k:match("^ENV_") then
return os.getenv(k:sub(5));
end
+ local val = rawget_option(config_table, env.__currenthost or "*", k);
+ if val ~= nil then
+ return val;
+ end
return rawget(_G, k);
end,
__newindex = function (_, k, v)