From 0c69c52fc6462e42b5fdadceaf919763c8e04e8d Mon Sep 17 00:00:00 2001 From: William Boman Date: Sun, 5 Dec 2021 14:03:37 +0100 Subject: fix(installers/shell): pass script via arg, when possible (#307) --- lua/nvim-lsp-installer/installers/shell.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lua') diff --git a/lua/nvim-lsp-installer/installers/shell.lua b/lua/nvim-lsp-installer/installers/shell.lua index 34cfc524..62506155 100644 --- a/lua/nvim-lsp-installer/installers/shell.lua +++ b/lua/nvim-lsp-installer/installers/shell.lua @@ -16,7 +16,7 @@ local function shell(opts) }), }, callback) - if stdio then + if stdio and opts.cmd then local stdin = stdio[1] stdin:write(opts.cmd) @@ -37,7 +37,7 @@ function M.bash(raw_script, opts) return shell { shell = "bash", - cmd = (opts.prefix or "") .. raw_script, + args = { "-c", (opts.prefix or "") .. raw_script }, env = opts.env, } end @@ -68,7 +68,7 @@ function M.cmd(raw_script, opts) return shell { shell = "cmd.exe", - cmd = raw_script, + args = { "/C", raw_script }, env = opts.env, } end @@ -85,8 +85,7 @@ function M.powershell(raw_script, opts) return shell { shell = "powershell.exe", - args = { "-NoProfile" }, - cmd = (opts.prefix or "") .. raw_script, + args = { "-NoProfile", "-Command", (opts.prefix or "") .. raw_script }, env = opts.env, } end -- cgit v1.2.3-70-g09d2