Added in Config Postload (#1336)

* Added in an `onload` variable to configs which is called by the plugin loader.

* Used appropriate parameter.

* Fixed tabbing.
This commit is contained in:
Adam 2023-01-19 10:14:45 -05:00 committed by GitHub
parent 9308dfdd66
commit aa627d4023
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1010,7 +1010,7 @@ function core.load_plugins()
table.insert(list, plugin.file)
elseif config.plugins[plugin.name] ~= false then
local start = system.get_time()
local ok = core.try(require, "plugins." .. plugin.name)
local ok, loaded_plugin = core.try(require, "plugins." .. plugin.name)
if ok then
core.log_quiet(
"Loaded plugin %q from %s in %.1fms",
@ -1021,6 +1021,8 @@ function core.load_plugins()
end
if not ok then
no_errors = false
elseif config.plugins[plugin.name].onload then
core.try(config.plugins[plugin.name].onload, loaded_plugin)
end
end
end