diff options
author | 2020-12-08 09:44:32 -0500 | |
---|---|---|
committer | 2020-12-08 09:44:32 -0500 | |
commit | e70d4ebb34be2bfbd9e93cf862d8d4d68ddf37cb (patch) | |
tree | a83af7d1cc8e19b49f1a82ede6dc346a548cef1f /plugins/boot.lua | |
parent | 6082c57817462f56ca4bfdfd1908c4498677c4b9 (diff) |
plugins: Replace environment variable substitution function with core version
Diffstat (limited to 'plugins/boot.lua')
-rw-r--r-- | plugins/boot.lua | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/plugins/boot.lua b/plugins/boot.lua index 09be30ee401..3a4de6fcc7c 100644 --- a/plugins/boot.lua +++ b/plugins/boot.lua @@ -2,29 +2,10 @@ -- copyright-holders:Miodrag Milanovic require('lfs') --- add helper to lfs for plugins to use -function lfs.env_replace(str) - local pathsep = package.config:sub(1,1) - local function dorep(val) - ret = os.getenv(val) - if ret then - return ret - end - return val - end - - if pathsep == '\\' then - str = str:gsub("%%([%w_]+)%%", dorep) - else - str = str:gsub("%$([%w_]+)", dorep) - end - return str -end - _G._ = emu.lang_translate _G.emu.plugin = {} -- table to contain plugin interfaces -- substitute environment variables in the plugins path from options -local dirs = lfs.env_replace(manager:options().entries.pluginspath:value()) +local dirs = emu.subst_env(manager:options().entries.pluginspath:value()) -- and split the paths apart and make them suitable for package.path package.path = "" |