aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/installers/npm.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/installers/npm.lua')
-rw-r--r--lua/nvim-lsp-installer/installers/npm.lua14
1 files changed, 12 insertions, 2 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, {