diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-lsp-installer/installers/npm.lua | 14 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/ansiblels/init.lua | 5 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/init.lua | 1 |
3 files changed, 15 insertions, 5 deletions
diff --git a/lua/nvim-lsp-installer/installers/npm.lua b/lua/nvim-lsp-installer/installers/npm.lua index 0988c82a..f9ea7025 100644 --- a/lua/nvim-lsp-installer/installers/npm.lua +++ b/lua/nvim-lsp-installer/installers/npm.lua @@ -31,16 +31,26 @@ function M.packages(packages) end) end -function M.install(production) +function M.install(args) return ensure_npm(function(server, callback, context) process.spawn(npm, { - args = production and { "install", "--production" } or { "install" }, + args = vim.list_extend({ "install" }, args), cwd = server.root_dir, stdio_sink = context.stdio_sink, }, callback) end) end +function M.exec(executable, args) + return function(server, callback, context) + process.spawn(M.executable(server.root_dir, executable), { + args = args, + cwd = server.root_dir, + stdio_sink = context.stdio_sink, + }, callback) + end +end + function M.run(script) return ensure_npm(function(server, callback, context) process.spawn(npm, { diff --git a/lua/nvim-lsp-installer/servers/ansiblels/init.lua b/lua/nvim-lsp-installer/servers/ansiblels/init.lua index 889a60ba..a3903146 100644 --- a/lua/nvim-lsp-installer/servers/ansiblels/init.lua +++ b/lua/nvim-lsp-installer/servers/ansiblels/init.lua @@ -9,9 +9,10 @@ return function(name, root_dir) root_dir = root_dir, installer = { std.git_clone "https://github.com/ansible/ansible-language-server", - npm.install(), + npm.install { "npm@latest" }, -- ansiblels has quite a strict npm version requirement + npm.exec("npm", { "install" }), npm.run "compile", - npm.install(true), + npm.exec("npm", { "install", "--production" }), }, default_options = { filetypes = { "yaml", "yaml.ansible" }, diff --git a/lua/nvim-lsp-installer/servers/init.lua b/lua/nvim-lsp-installer/servers/init.lua index 5ff1419b..9a7a8045 100644 --- a/lua/nvim-lsp-installer/servers/init.lua +++ b/lua/nvim-lsp-installer/servers/init.lua @@ -93,7 +93,6 @@ local INITIALIZED_SERVERS = {} local cached_server_roots --- TODO rename me and maybe not export local function scan_server_roots() if cached_server_roots then return cached_server_roots |
