From aa052c3e50fa0271573c442446d3b0abc96e844f Mon Sep 17 00:00:00 2001 From: William Boman Date: Wed, 29 Sep 2021 19:50:21 +0200 Subject: don't assume bash location (#108) --- lua/nvim-lsp-installer/installers/shell.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lua/nvim-lsp-installer/installers/shell.lua') diff --git a/lua/nvim-lsp-installer/installers/shell.lua b/lua/nvim-lsp-installer/installers/shell.lua index 8cb263ef..2d0ccf6f 100644 --- a/lua/nvim-lsp-installer/installers/shell.lua +++ b/lua/nvim-lsp-installer/installers/shell.lua @@ -29,7 +29,21 @@ function M.bash(raw_script, opts) opts = vim.tbl_deep_extend("force", default_opts, opts or {}) return shell { - shell = "/bin/bash", + shell = "bash", + cmd = (opts.prefix or "") .. raw_script, + env = opts.env, + } +end + +function M.sh(raw_script, opts) + local default_opts = { + prefix = "set -euo pipefail;", + env = {}, + } + opts = vim.tbl_deep_extend("force", default_opts, opts or {}) + + return shell { + shell = "sh", cmd = (opts.prefix or "") .. raw_script, env = opts.env, } -- cgit v1.2.3-70-g09d2