aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/installers/go.lua
blob: f4c8524891448fc5d78e1551928fcabcb5091ec5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
local path = require("nvim-lsp-installer.path")
local shell = require("nvim-lsp-installer.installers.shell")

local M = {}

function M.packages(packages)
    return shell.raw(("go get %s"):format(table.concat(packages, " ")), {
        prefix = [[set -euo pipefail; export GO111MODULE=on; export GOBIN="$PWD"; export GOPATH="$PWD";]]
    })
end

function M.executable(root_dir, executable)
    return path.concat { root_dir, executable }
end

return M