diff options
| author | William Boman <william@redwill.se> | 2022-01-04 20:48:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-04 20:48:53 +0100 |
| commit | 34e039dcdd289da438bee7f5744d82365d89b24a (patch) | |
| tree | bb1ec1022f558faec1e31c7a4fb7cdab06f9a924 /lua/nvim-lsp-installer/installers | |
| parent | update issue templates (diff) | |
| download | mason-34e039dcdd289da438bee7f5744d82365d89b24a.tar mason-34e039dcdd289da438bee7f5744d82365d89b24a.tar.gz mason-34e039dcdd289da438bee7f5744d82365d89b24a.tar.bz2 mason-34e039dcdd289da438bee7f5744d82365d89b24a.tar.lz mason-34e039dcdd289da438bee7f5744d82365d89b24a.tar.xz mason-34e039dcdd289da438bee7f5744d82365d89b24a.tar.zst mason-34e039dcdd289da438bee7f5744d82365d89b24a.zip | |
fix(receipts): register receipt before pinning version number (#388)
Diffstat (limited to 'lua/nvim-lsp-installer/installers')
| -rw-r--r-- | lua/nvim-lsp-installer/installers/gem.lua | 9 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/installers/go.lua | 10 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/installers/pip3.lua | 10 |
3 files changed, 15 insertions, 14 deletions
diff --git a/lua/nvim-lsp-installer/installers/gem.lua b/lua/nvim-lsp-installer/installers/gem.lua index 56d7977f..c01f1449 100644 --- a/lua/nvim-lsp-installer/installers/gem.lua +++ b/lua/nvim-lsp-installer/installers/gem.lua @@ -19,16 +19,17 @@ function M.packages(packages) ---@type ServerInstallerFunction function(_, callback, ctx) local pkgs = Data.list_copy(packages or {}) - if ctx.requested_server_version then - -- The "head" package is the recipient for the requested version. It's.. by design... don't ask. - pkgs[1] = ("%s:%s"):format(pkgs[1], ctx.requested_server_version) - end ctx.receipt:with_primary_source(ctx.receipt.gem(pkgs[1])) for i = 2, #pkgs do ctx.receipt:with_secondary_source(ctx.receipt.gem(pkgs[i])) end + if ctx.requested_server_version then + -- The "head" package is the recipient for the requested version. It's.. by design... don't ask. + pkgs[1] = ("%s:%s"):format(pkgs[1], ctx.requested_server_version) + end + process.spawn(M.gem_cmd, { args = { "install", diff --git a/lua/nvim-lsp-installer/installers/go.lua b/lua/nvim-lsp-installer/installers/go.lua index 4a979c5d..a3b21176 100644 --- a/lua/nvim-lsp-installer/installers/go.lua +++ b/lua/nvim-lsp-installer/installers/go.lua @@ -22,16 +22,16 @@ function M.packages(packages) stdio_sink = ctx.stdio_sink, } - if ctx.requested_server_version then - -- The "head" package is the recipient for the requested version. It's.. by design... don't ask. - pkgs[1] = ("%s@%s"):format(pkgs[1], ctx.requested_server_version) - end - ctx.receipt:with_primary_source(ctx.receipt.go(pkgs[1])) for i = 2, #pkgs do ctx.receipt:with_secondary_source(ctx.receipt.go(pkgs[i])) end + if ctx.requested_server_version then + -- The "head" package is the recipient for the requested version. It's.. by design... don't ask. + pkgs[1] = ("%s@%s"):format(pkgs[1], ctx.requested_server_version) + end + c.run("go", vim.list_extend({ "get", "-v" }, pkgs)) c.run("go", { "clean", "-modcache" }) diff --git a/lua/nvim-lsp-installer/installers/pip3.lua b/lua/nvim-lsp-installer/installers/pip3.lua index 3ef6f4eb..b4dc4f5a 100644 --- a/lua/nvim-lsp-installer/installers/pip3.lua +++ b/lua/nvim-lsp-installer/installers/pip3.lua @@ -31,17 +31,17 @@ local function create_installer(python_executable, packages) env = process.graft_env(M.env(ctx.install_dir)), } + ctx.receipt:with_primary_source(ctx.receipt.pip3(pkgs[1])) + for i = 2, #pkgs do + ctx.receipt:with_secondary_source(ctx.receipt.pip3(pkgs[i])) + end + c.run(python_executable, { "-m", "venv", REL_INSTALL_DIR }) if ctx.requested_server_version then -- The "head" package is the recipient for the requested version. It's.. by design... don't ask. pkgs[1] = ("%s==%s"):format(pkgs[1], ctx.requested_server_version) end - ctx.receipt:with_primary_source(ctx.receipt.pip3(pkgs[1])) - for i = 2, #pkgs do - ctx.receipt:with_secondary_source(ctx.receipt.pip3(pkgs[i])) - end - local install_command = { "-m", "pip", "install", "-U" } vim.list_extend(install_command, settings.current.pip.install_args) c.run("python", vim.list_extend(install_command, pkgs)) |
