|
|
@ -24,7 +24,7 @@ function foreach_module_script(cb)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
local enabled_map = {}
|
|
|
|
local enabled_map = nil
|
|
|
|
|
|
|
|
|
|
|
|
local function process_script(env_name, env)
|
|
|
|
local function process_script(env_name, env)
|
|
|
|
local global_name = 'isEnabled'
|
|
|
|
local global_name = 'isEnabled'
|
|
|
@ -44,10 +44,14 @@ function reload()
|
|
|
|
foreach_module_script(process_script)
|
|
|
|
foreach_module_script(process_script)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local function ensure_loaded()
|
|
|
|
|
|
|
|
if not enabled_map then
|
|
|
|
|
|
|
|
reload()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function list()
|
|
|
|
function list()
|
|
|
|
-- call reload every time we list to make sure we get scripts that have
|
|
|
|
ensure_loaded()
|
|
|
|
-- just been added
|
|
|
|
|
|
|
|
reload()
|
|
|
|
|
|
|
|
for name,fn in pairs(enabled_map) do
|
|
|
|
for name,fn in pairs(enabled_map) do
|
|
|
|
print(('%21s %-3s'):format(name..':', fn() and 'on' or 'off'))
|
|
|
|
print(('%21s %-3s'):format(name..':', fn() and 'on' or 'off'))
|
|
|
|
end
|
|
|
|
end
|
|
|
|