mirror of
https://github.com/holub/mame
synced 2025-06-16 09:20:04 +03:00
LUA boot.lua file now handles multiple paths (delimited by semicolons)
on -pluginspath
This commit is contained in:
parent
775b486c73
commit
d4cb1ba742
@ -22,9 +22,18 @@ function lfs.env_replace(str)
|
|||||||
end
|
end
|
||||||
|
|
||||||
_G._ = emu.lang_translate
|
_G._ = emu.lang_translate
|
||||||
local dir = lfs.env_replace(manager:options().entries.pluginspath:value())
|
|
||||||
|
|
||||||
package.path = dir .. "/?.lua;" .. dir .. "/?/init.lua"
|
-- substitute environment variables in the plugins path from options
|
||||||
|
local dirs = lfs.env_replace(manager:options().entries.pluginspath:value())
|
||||||
|
|
||||||
|
-- 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
|
||||||
|
|
||||||
for _,entry in pairs(manager:plugins()) do
|
for _,entry in pairs(manager:plugins()) do
|
||||||
if (entry.type == "plugin" and entry.start) then
|
if (entry.type == "plugin" and entry.start) then
|
||||||
|
Loading…
Reference in New Issue
Block a user