aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/installers/shell.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-10-25 14:55:47 +0200
committerGitHub <noreply@github.com>2021-10-25 14:55:47 +0200
commitf60d78a29fbe772e0724ee0853a13894b9765fdf (patch)
treeadf8fd822587d779c5b90d5ed30987a982fd497e /lua/nvim-lsp-installer/installers/shell.lua
parentfix :LspPrintInstalled (diff)
downloadmason-f60d78a29fbe772e0724ee0853a13894b9765fdf.tar
mason-f60d78a29fbe772e0724ee0853a13894b9765fdf.tar.gz
mason-f60d78a29fbe772e0724ee0853a13894b9765fdf.tar.bz2
mason-f60d78a29fbe772e0724ee0853a13894b9765fdf.tar.lz
mason-f60d78a29fbe772e0724ee0853a13894b9765fdf.tar.xz
mason-f60d78a29fbe772e0724ee0853a13894b9765fdf.tar.zst
mason-f60d78a29fbe772e0724ee0853a13894b9765fdf.zip
add proper emmylua annotations (#196)
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 = {},