summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2016-05-26 17:24:56 -0500
committer cracyc <cracyc@users.noreply.github.com>2016-05-26 17:24:56 -0500
commit0522e44d2f0aa36e7225e44cfd63a8371019c31b (patch)
tree90c62eabed0474114f783ba452c29f559bcd28d1
parent6f07f5c299805ddc7380386b7ac7eabc94e3d342 (diff)
boot.lua: make pluginspath apply here too (nw)
-rw-r--r--plugins/boot.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/boot.lua b/plugins/boot.lua
index b8b415e404a..7acf23ca19f 100644
--- a/plugins/boot.lua
+++ b/plugins/boot.lua
@@ -1,8 +1,8 @@
-- license:BSD-3-Clause
-- copyright-holders:Miodrag Milanovic
require('lfs')
-local cwd = lfs.currentdir()
-package.path = cwd .. "/plugins/?.lua;" .. cwd .. "/plugins/?/init.lua"
+local dir = manager:options().entries.pluginspath:value()
+package.path = dir .. "/?.lua;" .. dir .. "/?/init.lua"
local json = require('json')
function readAll(file)
@@ -12,16 +12,16 @@ function readAll(file)
return content
end
-for file in lfs.dir("plugins") do
- if (file~="." and file~=".." and lfs.attributes("plugins/" .. file,"mode")=="directory") then
- local filename = "plugins/" .. file .. "/plugin.json"
+for file in lfs.dir(dir) do
+ if (file~="." and file~=".." and lfs.attributes(dir .. "/" .. file,"mode")=="directory") then
+ local filename = dir .. "/" .. file .. "/plugin.json"
local meta = json.parse(readAll(filename))
if (meta["plugin"]["type"]=="plugin") and (mame_manager:plugins().entries[meta["plugin"]["name"]]~=nil) then
local entry = mame_manager:plugins().entries[meta["plugin"]["name"]]
if (entry:value()==true) then
emu.print_verbose("Starting plugin " .. meta["plugin"]["name"] .. "...")
plugin = require(meta["plugin"]["name"])
- if plugin.set_folder~=nil then plugin.set_folder("plugins/" .. file) end
+ if plugin.set_folder~=nil then plugin.set_folder(dir .. "/" .. file) end
plugin.startplugin();
end
end