aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/core/clients
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-03-06 12:19:39 +0100
committerWilliam Boman <william@redwill.se>2022-03-06 13:06:50 +0100
commita28297493810c30edf150cec78c02920e7112cb2 (patch)
tree165ae53a747423f990e3f79d298fe4edf74c8086 /lua/nvim-lsp-installer/core/clients
parentfix(solang): use llvm13 (diff)
downloadmason-a28297493810c30edf150cec78c02920e7112cb2.tar
mason-a28297493810c30edf150cec78c02920e7112cb2.tar.gz
mason-a28297493810c30edf150cec78c02920e7112cb2.tar.bz2
mason-a28297493810c30edf150cec78c02920e7112cb2.tar.lz
mason-a28297493810c30edf150cec78c02920e7112cb2.tar.xz
mason-a28297493810c30edf150cec78c02920e7112cb2.tar.zst
mason-a28297493810c30edf150cec78c02920e7112cb2.zip
fix(fetch): shift args to put callback arg last
Diffstat (limited to 'lua/nvim-lsp-installer/core/clients')
-rw-r--r--lua/nvim-lsp-installer/core/clients/github.lua28
1 files changed, 14 insertions, 14 deletions
diff --git a/lua/nvim-lsp-installer/core/clients/github.lua b/lua/nvim-lsp-installer/core/clients/github.lua
index 27352e8d..b78a8964 100644
--- a/lua/nvim-lsp-installer/core/clients/github.lua
+++ b/lua/nvim-lsp-installer/core/clients/github.lua
@@ -13,18 +13,18 @@ local M = {}
---@param callback fun(error: string|nil, data: GitHubRelease[]|nil)
function M.fetch_releases(repo, callback)
log.fmt_trace("Fetching GitHub releases for repo=%s", repo)
- fetch(("https://api.github.com/repos/%s/releases"):format(repo), function(err, response)
+ fetch(("https://api.github.com/repos/%s/releases"):format(repo), {
+ custom_fetcher = {
+ cmd = "gh",
+ args = { "api", ("repos/%s/releases"):format(repo) },
+ },
+ }, function(err, response)
if err then
log.fmt_error("Failed to fetch releases for repo=%s", repo)
return callback("Failed to fetch GitHub releases.", nil)
end
callback(nil, vim.json.decode(response))
- end, {
- custom_fetcher = {
- cmd = "gh",
- args = { "api", ("repos/%s/releases"):format(repo) },
- },
- })
+ end)
end
---@alias FetchLatestGithubReleaseOpts {tag_name_pattern:string}
@@ -61,18 +61,18 @@ end
---@param repo string The GitHub repo ("username/repo").
---@param callback fun(err: string|nil, tags: GitHubTag[]|nil)
function M.fetch_tags(repo, callback)
- fetch(("https://api.github.com/repos/%s/tags"):format(repo), function(err, response)
+ fetch(("https://api.github.com/repos/%s/tags"):format(repo), {
+ custom_fetcher = {
+ cmd = "gh",
+ args = { "api", ("repos/%s/tags"):format(repo) },
+ },
+ }, function(err, response)
if err then
log.fmt_error("Failed to fetch tags for repo=%s", err)
return callback("Failed to fetch tags.", nil)
end
callback(nil, vim.json.decode(response))
- end, {
- custom_fetcher = {
- cmd = "gh",
- args = { "api", ("repos/%s/tags"):format(repo) },
- },
- })
+ end)
end
---@param repo string The GitHub repo ("username/repo").