Skip to content

Commit

Permalink
fix(installers/shell): pass script via arg, when possible (chipsallia…
Browse files Browse the repository at this point in the history
  • Loading branch information
williamboman authored Dec 5, 2021
1 parent 8fab72f commit 0c69c52
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lua/nvim-lsp-installer/installers/shell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0c69c52

Please sign in to comment.