Merge pull request #2749 from myk002/myk_no_auto_refresh

don't autorefresh the enableable tools list
develop
Myk 2023-01-29 16:54:38 -08:00 committed by GitHub
commit edb2859ad4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

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