aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/managers/luarocks/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-07-22 18:26:23 +0200
committerGitHub <noreply@github.com>2022-07-22 18:26:23 +0200
commit1e3c60c46ab32416df56e7c19b4475afd5abe186 (patch)
tree215da41bcebcb3b81984a393341e7f74844393dc /lua/mason-core/managers/luarocks/init.lua
parentdocs: fixup the mason.txt help (#115) (diff)
downloadmason-1e3c60c46ab32416df56e7c19b4475afd5abe186.tar
mason-1e3c60c46ab32416df56e7c19b4475afd5abe186.tar.gz
mason-1e3c60c46ab32416df56e7c19b4475afd5abe186.tar.bz2
mason-1e3c60c46ab32416df56e7c19b4475afd5abe186.tar.lz
mason-1e3c60c46ab32416df56e7c19b4475afd5abe186.tar.xz
mason-1e3c60c46ab32416df56e7c19b4475afd5abe186.tar.zst
mason-1e3c60c46ab32416df56e7c19b4475afd5abe186.zip
feat: add luaformatter (#116)
Co-authored-by: Ali Shahid <canttell@gmail>
Diffstat (limited to 'lua/mason-core/managers/luarocks/init.lua')
-rw-r--r--lua/mason-core/managers/luarocks/init.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/lua/mason-core/managers/luarocks/init.lua b/lua/mason-core/managers/luarocks/init.lua
index 0deb2e1f..9fd59ca1 100644
--- a/lua/mason-core/managers/luarocks/init.lua
+++ b/lua/mason-core/managers/luarocks/init.lua
@@ -21,7 +21,7 @@ local function with_receipt(package)
end
---@param package string: The luarock package to install.
----@param opts { dev: boolean, bin : string[] | nil } | nil
+---@param opts { dev: boolean?, server: string?, bin : string[]? | nil }?
function M.package(package, opts)
return function()
return M.install(package, opts).with_receipt()
@@ -30,7 +30,7 @@ end
---@async
---@param pkg string: The luarock package to install.
----@param opts { dev: boolean, bin : string[] | nil } | nil
+---@param opts { dev: boolean?, server: string?, bin : string[]? | nil }?
function M.install(pkg, opts)
opts = opts or {}
local ctx = installer.context()
@@ -40,6 +40,7 @@ function M.install(pkg, opts)
"--tree",
ctx.cwd:get(),
opts.dev and "--dev" or vim.NIL,
+ opts.server and ("--server=%s"):format(opts.server) or vim.NIL,
pkg,
ctx.requested_version:or_else(vim.NIL),
}