diff options
| author | William Boman <william@redwill.se> | 2021-09-07 03:19:12 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2021-09-07 03:26:46 +0200 |
| commit | edf900163bf4ba1581b5350799a3ba4424a38006 (patch) | |
| tree | deb771f4318217ae07d0944d31e22a7a0621011d /lua/nvim-lsp-installer/installers | |
| parent | add direct integration with libuv instead of going through termopen, also imp... (diff) | |
| download | mason-edf900163bf4ba1581b5350799a3ba4424a38006.tar mason-edf900163bf4ba1581b5350799a3ba4424a38006.tar.gz mason-edf900163bf4ba1581b5350799a3ba4424a38006.tar.bz2 mason-edf900163bf4ba1581b5350799a3ba4424a38006.tar.lz mason-edf900163bf4ba1581b5350799a3ba4424a38006.tar.xz mason-edf900163bf4ba1581b5350799a3ba4424a38006.tar.zst mason-edf900163bf4ba1581b5350799a3ba4424a38006.zip | |
some fixes
Diffstat (limited to 'lua/nvim-lsp-installer/installers')
| -rw-r--r-- | lua/nvim-lsp-installer/installers/init.lua | 4 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/installers/npm.lua | 4 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/installers/pip3.lua | 2 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/installers/shell.lua | 10 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/installers/zx.lua | 2 |
5 files changed, 12 insertions, 10 deletions
diff --git a/lua/nvim-lsp-installer/installers/init.lua b/lua/nvim-lsp-installer/installers/init.lua index 991c773e..98bb78bc 100644 --- a/lua/nvim-lsp-installer/installers/init.lua +++ b/lua/nvim-lsp-installer/installers/init.lua @@ -35,14 +35,14 @@ end function M.when(platform_table) return function(server, callback, context) - if platform.is_unix() then + if platform.is_unix then if platform_table.unix then platform_table.unix(server, callback, context) else context.stdio_sink.stderr(("Unix is not yet supported for server %q."):format(server.name)) callback(false) end - elseif platform.is_win() then + elseif platform.is_win then if platform_table.win then platform_table.win(server, callback, context) else diff --git a/lua/nvim-lsp-installer/installers/npm.lua b/lua/nvim-lsp-installer/installers/npm.lua index d3c8167f..93bbb5ae 100644 --- a/lua/nvim-lsp-installer/installers/npm.lua +++ b/lua/nvim-lsp-installer/installers/npm.lua @@ -6,7 +6,7 @@ local M = {} function M.packages(packages) return function(server, callback, context) - process.spawn(platform.is_win() and "npm.cmd" or "npm", { + process.spawn(platform.is_win and "npm.cmd" or "npm", { args = vim.list_extend({ "install" }, packages), cwd = server.root_dir, stdio_sink = context.stdio_sink, @@ -19,7 +19,7 @@ function M.executable(root_dir, executable) root_dir, "node_modules", ".bin", - platform.is_win() and ("%s.cmd"):format(executable) or executable, + platform.is_win and ("%s.cmd"):format(executable) or executable, } end diff --git a/lua/nvim-lsp-installer/installers/pip3.lua b/lua/nvim-lsp-installer/installers/pip3.lua index 5aefe372..277e0321 100644 --- a/lua/nvim-lsp-installer/installers/pip3.lua +++ b/lua/nvim-lsp-installer/installers/pip3.lua @@ -21,7 +21,7 @@ function M.packages(packages) end function M.executable(root_dir, executable) - return path.concat { root_dir, REL_INSTALL_DIR, platform.is_win() and "Scripts" or "bin", executable } + return path.concat { root_dir, REL_INSTALL_DIR, platform.is_win and "Scripts" or "bin", executable } end return M diff --git a/lua/nvim-lsp-installer/installers/shell.lua b/lua/nvim-lsp-installer/installers/shell.lua index 37b5e03f..2ba84305 100644 --- a/lua/nvim-lsp-installer/installers/shell.lua +++ b/lua/nvim-lsp-installer/installers/shell.lua @@ -11,11 +11,13 @@ local function shell(opts) env = process.graft_env(opts.env or {}), }, callback) - local stdin = stdio[1] + if stdio then + local stdin = stdio[1] - stdin:write(opts.cmd) - stdin:write "\n" - stdin:close() + stdin:write(opts.cmd) + stdin:write "\n" + stdin:close() + end end end diff --git a/lua/nvim-lsp-installer/installers/zx.lua b/lua/nvim-lsp-installer/installers/zx.lua index 9b24e1af..7bebdc33 100644 --- a/lua/nvim-lsp-installer/installers/zx.lua +++ b/lua/nvim-lsp-installer/installers/zx.lua @@ -36,7 +36,7 @@ local function zx_installer(force) fs.mkdirp(INSTALL_DIR) -- todo use process installer - local handle, pid = process.spawn(platform.is_win() and "npm.cmd" or "npm", { + local handle, pid = process.spawn(platform.is_win and "npm.cmd" or "npm", { args = { npm_command, "zx@1" }, cwd = INSTALL_DIR, stdio_sink = opts.stdio_sink, |
