aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/process.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-11-25 06:55:18 +0100
committerGitHub <noreply@github.com>2021-11-25 06:55:18 +0100
commitb1e0f89f4c85a0767a76ff3e0db4c888b6ac3002 (patch)
tree706375863687f9a64fd2fd1da5f4d5f86fbbe95d /lua/nvim-lsp-installer/process.lua
parentactions/auto-assign-issues: add column_name arg (diff)
downloadmason-b1e0f89f4c85a0767a76ff3e0db4c888b6ac3002.tar
mason-b1e0f89f4c85a0767a76ff3e0db4c888b6ac3002.tar.gz
mason-b1e0f89f4c85a0767a76ff3e0db4c888b6ac3002.tar.bz2
mason-b1e0f89f4c85a0767a76ff3e0db4c888b6ac3002.tar.lz
mason-b1e0f89f4c85a0767a76ff3e0db4c888b6ac3002.tar.xz
mason-b1e0f89f4c85a0767a76ff3e0db4c888b6ac3002.tar.zst
mason-b1e0f89f4c85a0767a76ff3e0db4c888b6ac3002.zip
fix(windows): unset PSMODULEPATH before invoking powershell scripts (#278)
Diffstat (limited to 'lua/nvim-lsp-installer/process.lua')
-rw-r--r--lua/nvim-lsp-installer/process.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/lua/nvim-lsp-installer/process.lua b/lua/nvim-lsp-installer/process.lua
index 7fe3625c..9316fd38 100644
--- a/lua/nvim-lsp-installer/process.lua
+++ b/lua/nvim-lsp-installer/process.lua
@@ -47,15 +47,19 @@ end
---Merges the provided env param with the user's full environent. Provided env has precedence.
---@param env table<string, string>
-function M.graft_env(env)
+---@param excluded_var_names string[]|nil
+function M.graft_env(env, excluded_var_names)
+ local excluded_var_names_set = excluded_var_names and Data.set_of(excluded_var_names) or {}
local merged_env = {}
for key, val in pairs(initial_environ) do
- if env[key] == nil then
+ if not excluded_var_names_set[key] and env[key] == nil then
merged_env[#merged_env + 1] = key .. "=" .. val
end
end
for key, val in pairs(env) do
- merged_env[#merged_env + 1] = key .. "=" .. val
+ if not excluded_var_names_set[key] then
+ merged_env[#merged_env + 1] = key .. "=" .. val
+ end
end
return merged_env
end