diff options
author | 2019-07-25 13:17:57 -0400 | |
---|---|---|
committer | 2019-07-25 13:19:43 -0400 | |
commit | d4cb1ba742fecd3e2ba0610ec046b977ad4bd33d (patch) | |
tree | 454b472ba0315062414158542dd950889933e9af | |
parent | 775b486c734d9a5e0c2c8c17c3a3b25f43789180 (diff) |
LUA boot.lua file now handles multiple paths (delimited by semicolons)
on -pluginspath
-rw-r--r-- | plugins/boot.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/boot.lua b/plugins/boot.lua index 98eb14baa86..858e1a5b4db 100644 --- a/plugins/boot.lua +++ b/plugins/boot.lua @@ -22,9 +22,18 @@ function lfs.env_replace(str) end _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 if (entry.type == "plugin" and entry.start) then |