2016-03-05 11:03:34 +01:00
|
|
|
-- license:BSD-3-Clause
|
|
|
|
|
-- copyright-holders:Miodrag Milanovic
|
2021-05-07 02:09:13 +10:00
|
|
|
require('lfs')
|
2016-07-09 15:11:30 -05:00
|
|
|
|
2017-09-03 15:08:08 -05:00
|
|
|
_G._ = emu.lang_translate
|
2021-10-11 15:02:55 +11:00
|
|
|
_G._p = emu.lang_translate
|
2021-10-09 12:16:17 +11:00
|
|
|
_G.N_ = function (message) return message end
|
|
|
|
|
_G.N_p = function (context, message) return message end
|
2020-09-13 10:00:00 -05:00
|
|
|
_G.emu.plugin = {} -- table to contain plugin interfaces
|
2019-07-25 13:17:57 -04:00
|
|
|
-- substitute environment variables in the plugins path from options
|
2022-12-16 14:03:59 -05:00
|
|
|
local dirs = manager.options.entries.pluginspath:value()
|
2019-07-25 13:17:57 -04:00
|
|
|
|
|
|
|
|
-- and split the paths apart and make them suitable for package.path
|
|
|
|
|
package.path = ""
|
|
|
|
|
for dir in string.gmatch(dirs, "([^;]+)") do
|
|
|
|
|
if (package.path ~= "") then
|
|
|
|
|
package.path = package.path .. ";"
|
|
|
|
|
end
|
|
|
|
|
package.path = package.path .. dir .. "/?.lua;" .. dir .. "/?/init.lua"
|
|
|
|
|
end
|
2016-02-14 10:58:18 +01:00
|
|
|
|
2020-12-27 01:32:37 +11:00
|
|
|
for _,entry in pairs(manager.plugins) do
|
2019-07-24 07:14:56 -04:00
|
|
|
if (entry.type == "plugin" and entry.start) then
|
|
|
|
|
emu.print_verbose("Starting plugin " .. entry.name .. "...")
|
|
|
|
|
plugin = require(entry.name)
|
|
|
|
|
if plugin.set_folder~=nil then plugin.set_folder(entry.directory) end
|
|
|
|
|
plugin.startplugin();
|
2016-02-14 19:48:44 +01:00
|
|
|
end
|
|
|
|
|
end
|