diff options
| author | William Boman <william@redwill.se> | 2022-01-03 15:12:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-03 15:12:53 +0100 |
| commit | e8530f4059279a0d6b5e5f8891d04ffb1ade29a3 (patch) | |
| tree | b90ddf4479314af49e1eca3325262ef45e5f630d /lua/nvim-lsp-installer/installers/go.lua | |
| parent | health: add neovim version check (diff) | |
| download | mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.tar mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.tar.gz mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.tar.bz2 mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.tar.lz mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.tar.xz mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.tar.zst mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.zip | |
write install receipts (#379)
Diffstat (limited to 'lua/nvim-lsp-installer/installers/go.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/installers/go.lua | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lua/nvim-lsp-installer/installers/go.lua b/lua/nvim-lsp-installer/installers/go.lua index 10ac74d8..4a979c5d 100644 --- a/lua/nvim-lsp-installer/installers/go.lua +++ b/lua/nvim-lsp-installer/installers/go.lua @@ -10,21 +10,26 @@ function M.packages(packages) return installers.pipe { std.ensure_executables { { "go", "go was not found in path, refer to https://golang.org/doc/install." } }, ---@type ServerInstallerFunction - function(_, callback, context) + function(_, callback, ctx) local pkgs = Data.list_copy(packages or {}) local c = process.chain { env = process.graft_env { GO111MODULE = "on", - GOBIN = context.install_dir, - GOPATH = context.install_dir, + GOBIN = ctx.install_dir, + GOPATH = ctx.install_dir, }, - cwd = context.install_dir, - stdio_sink = context.stdio_sink, + cwd = ctx.install_dir, + stdio_sink = ctx.stdio_sink, } - if context.requested_server_version then + 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], context.requested_server_version) + 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 c.run("go", vim.list_extend({ "get", "-v" }, pkgs)) |
