aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-05-21 17:41:42 +0200
committerGitHub <noreply@github.com>2022-05-21 17:41:42 +0200
commit63f950401c666e18a82d93a7e6e1b0d7044f0432 (patch)
tree8087f03d550d765a1a01618d899d7ffbd0a9cf0b /lua
parentrun autogen_metadata.lua (diff)
downloadmason-63f950401c666e18a82d93a7e6e1b0d7044f0432.tar
mason-63f950401c666e18a82d93a7e6e1b0d7044f0432.tar.gz
mason-63f950401c666e18a82d93a7e6e1b0d7044f0432.tar.bz2
mason-63f950401c666e18a82d93a7e6e1b0d7044f0432.tar.lz
mason-63f950401c666e18a82d93a7e6e1b0d7044f0432.tar.xz
mason-63f950401c666e18a82d93a7e6e1b0d7044f0432.tar.zst
mason-63f950401c666e18a82d93a7e6e1b0d7044f0432.zip
feat(github): add setting to customize asset download url (#711)
Closes #678.
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-lsp-installer/core/managers/github/init.lua3
-rw-r--r--lua/nvim-lsp-installer/settings.lua9
2 files changed, 11 insertions, 1 deletions
diff --git a/lua/nvim-lsp-installer/core/managers/github/init.lua b/lua/nvim-lsp-installer/core/managers/github/init.lua
index b3721705..10c7c049 100644
--- a/lua/nvim-lsp-installer/core/managers/github/init.lua
+++ b/lua/nvim-lsp-installer/core/managers/github/init.lua
@@ -4,6 +4,7 @@ local client = require "nvim-lsp-installer.core.managers.github.client"
local platform = require "nvim-lsp-installer.core.platform"
local Result = require "nvim-lsp-installer.core.result"
local _ = require "nvim-lsp-installer.core.functional"
+local settings = require "nvim-lsp-installer.settings"
local M = {}
@@ -59,7 +60,7 @@ function M.release_file(opts)
0
)
end
- local download_url = ("https://github.com/%s/releases/download/%s/%s"):format(opts.repo, release, asset_file)
+ local download_url = settings.current.github.download_url_template:format(opts.repo, release, asset_file)
return {
release = release,
download_url = download_url,
diff --git a/lua/nvim-lsp-installer/settings.lua b/lua/nvim-lsp-installer/settings.lua
index e346763f..dd4a3d18 100644
--- a/lua/nvim-lsp-installer/settings.lua
+++ b/lua/nvim-lsp-installer/settings.lua
@@ -63,6 +63,15 @@ local DEFAULT_SETTINGS = {
-- Limit for the maximum amount of servers to be installed at the same time. Once this limit is reached, any further
-- servers that are requested to be installed will be put in a queue.
max_concurrent_installers = 4,
+
+ github = {
+ -- The template URL to use when downloading assets from GitHub.
+ -- The placeholders are the following (in order):
+ -- 1. The repository (e.g. "rust-lang/rust-analyzer")
+ -- 2. The release version (e.g. "v0.3.0")
+ -- 3. The asset name (e.g. "rust-analyzer-v0.3.0-x86_64-unknown-linux-gnu.tar.gz")
+ download_url_template = "https://github.com/%s/releases/download/%s/%s",
+ },
}
M._DEFAULT_SETTINGS = DEFAULT_SETTINGS