Support setting multiple keys in config
parent
12d5f0beba
commit
ac18443b53
|
@ -13,7 +13,14 @@ function config.define(key, schema)
|
||||||
config_schema[key] = schema or true
|
config_schema[key] = schema or true
|
||||||
end
|
end
|
||||||
|
|
||||||
function config.set(key, value)
|
function config.set(keyOrTable, value)
|
||||||
|
if type(keyOrTable) == "table" then
|
||||||
|
for key, value in pairs(keyOrTable) do
|
||||||
|
config.set(key, value)
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local key = keyOrTable
|
||||||
local schema = config_schema[key]
|
local schema = config_schema[key]
|
||||||
if schema == nil then
|
if schema == nil then
|
||||||
error("Config key not defined: " .. key)
|
error("Config key not defined: " .. key)
|
||||||
|
|
Loading…
Reference in New Issue