diff options
author | 2016-05-26 17:24:56 -0500 | |
---|---|---|
committer | 2016-05-26 17:24:56 -0500 | |
commit | 0522e44d2f0aa36e7225e44cfd63a8371019c31b (patch) | |
tree | 90c62eabed0474114f783ba452c29f559bcd28d1 /plugins/boot.lua | |
parent | 6f07f5c299805ddc7380386b7ac7eabc94e3d342 (diff) |
boot.lua: make pluginspath apply here too (nw)
Diffstat (limited to 'plugins/boot.lua')
-rw-r--r-- | plugins/boot.lua | 12 |
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 |