Skip to content

Commit

Permalink
Fix problem with plugin loading
Browse files Browse the repository at this point in the history
Introduced with PR #73
  • Loading branch information
franko committed Mar 5, 2021
1 parent bdc4734 commit 3506ff4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions data/core/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,9 @@ function core.load_plugins()
local no_errors = true
for _, root_dir in ipairs {USERDIR, DATADIR} do
local files = system.list_dir(root_dir .. "/plugins")
for _, plugin_path in ipairs(files or {}) do
local basename = common.basename(plugin_path)
if system.get_file_info(plugin_path).type == "file" then
basename = basename:match("(.-)%.lua$")
end
if basename ~= nil and config[basename] ~= false then
for _, filename in ipairs(files or {}) do
local basename = filename:match("(.-)%.lua$")
if basename and config[basename] ~= false then
local modname = "plugins." .. basename
local ok = core.try(require, modname)
-- Normally a log line is added for each loaded plugin which is a
Expand Down

0 comments on commit 3506ff4

Please sign in to comment.