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 George Sokianos
parent 12bae1ec95
commit 4682092b8d
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