aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/installers/shell.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/installers/shell.lua')
-rw-r--r--lua/nvim-lsp-installer/installers/shell.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/installers/shell.lua b/lua/nvim-lsp-installer/installers/shell.lua
index 752a216c..35f0cf6e 100644
--- a/lua/nvim-lsp-installer/installers/shell.lua
+++ b/lua/nvim-lsp-installer/installers/shell.lua
@@ -3,7 +3,9 @@ local process = require "nvim-lsp-installer.process"
local M = {}
+---@param opts {shell: string, cmd: string[], env: table|nil}
local function shell(opts)
+ ---@type ServerInstallerFunction
return function(server, callback, context)
local _, stdio = process.spawn(opts.shell, {
cwd = server.root_dir,
@@ -21,6 +23,8 @@ local function shell(opts)
end
end
+---@param raw_script string @The bash script to execute as-is.
+---@param opts {prefix: string, env: table}
function M.bash(raw_script, opts)
local default_opts = {
prefix = "set -euo pipefail;",
@@ -35,6 +39,8 @@ function M.bash(raw_script, opts)
}
end
+---@param raw_script string @The sh script to execute as-is.
+---@param opts {prefix: string, env: table}
function M.sh(raw_script, opts)
local default_opts = {
prefix = "set -eu;",
@@ -49,6 +55,8 @@ function M.sh(raw_script, opts)
}
end
+---@param raw_script string @The cmd.exe script to execute as-is.
+---@param opts {env: table}
function M.cmd(raw_script, opts)
local default_opts = {
env = {},
@@ -62,6 +70,8 @@ function M.cmd(raw_script, opts)
}
end
+---@param raw_script string @The powershell script to execute as-is.
+---@param opts {prefix: string, env: table}
function M.powershell(raw_script, opts)
local default_opts = {
env = {},
@@ -77,10 +87,15 @@ function M.powershell(raw_script, opts)
}
end
+---@deprecated Unsafe.
+---@param url string @The url to the powershell script to execute.
+---@param opts {prefix: string, env: table}
function M.remote_powershell(url, opts)
return M.powershell(("iwr -UseBasicParsing %q | iex"):format(url), opts)
end
+---@param raw_script string @A script that is compatible with bash and cmd.exe.
+---@param opts {env: table}
function M.polyshell(raw_script, opts)
local default_opts = {
env = {},