aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/installers/pip3.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/installers/pip3.lua')
-rw-r--r--lua/nvim-lsp-installer/installers/pip3.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/lua/nvim-lsp-installer/installers/pip3.lua b/lua/nvim-lsp-installer/installers/pip3.lua
index 234aad98..3dd44167 100644
--- a/lua/nvim-lsp-installer/installers/pip3.lua
+++ b/lua/nvim-lsp-installer/installers/pip3.lua
@@ -28,6 +28,7 @@ local function create_installer(python_executable, packages)
local c = process.chain {
cwd = ctx.install_dir,
stdio_sink = ctx.stdio_sink,
+ env = process.graft_env(M.env(ctx.install_dir)),
}
c.run(python_executable, { "-m", "venv", REL_INSTALL_DIR })
@@ -38,7 +39,7 @@ local function create_installer(python_executable, packages)
local install_command = { "-m", "pip", "install", "-U" }
vim.list_extend(install_command, settings.current.pip.install_args)
- c.run(M.executable(ctx.install_dir, "python"), vim.list_extend(install_command, pkgs))
+ c.run("python", vim.list_extend(install_command, pkgs))
c.spawn(callback)
end,
@@ -65,9 +66,12 @@ function M.packages(packages)
end
---@param root_dir string @The directory to resolve the executable from.
----@param executable string
-function M.executable(root_dir, executable)
- return path.concat { root_dir, REL_INSTALL_DIR, platform.is_win and "Scripts" or "bin", executable }
+function M.env(root_dir)
+ return {
+ PATH = process.extend_path {
+ path.concat { root_dir, REL_INSTALL_DIR, platform.is_win and "Scripts" or "bin" },
+ },
+ }
end
return M