aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorDaniel Bendel <d.bendel@pso-vertrieb.de>2021-04-15 10:49:25 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2021-04-15 16:56:49 +0200
commit6484c5c88012440386814ed1098fede753377676 (patch)
treeaec049794987297d61b2042f241813ec9a0f86a5 /lua
parentremove single-branch and branch arguments on git call (diff)
downloadnvim-treesitter-6484c5c88012440386814ed1098fede753377676.tar
nvim-treesitter-6484c5c88012440386814ed1098fede753377676.tar.gz
nvim-treesitter-6484c5c88012440386814ed1098fede753377676.tar.bz2
nvim-treesitter-6484c5c88012440386814ed1098fede753377676.tar.lz
nvim-treesitter-6484c5c88012440386814ed1098fede753377676.tar.xz
nvim-treesitter-6484c5c88012440386814ed1098fede753377676.tar.zst
nvim-treesitter-6484c5c88012440386814ed1098fede753377676.zip
split is_github_or_gitlab again
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/shell_command_selectors.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua
index c364c771f..59c96581c 100644
--- a/lua/nvim-treesitter/shell_command_selectors.lua
+++ b/lua/nvim-treesitter/shell_command_selectors.lua
@@ -122,12 +122,14 @@ end
function M.select_download_commands(repo, project_name, cache_folder, revision)
local can_use_tar = vim.fn.executable('tar') == 1 and vim.fn.executable('curl') == 1
- local is_github_or_gitlab = repo.url:find("github.com", 1, true) or repo.url:find("gitlab.com", 1, true)
+ local is_github = repo.url:find("github.com", 1, true)
+ local is_gitlab = repo.url:find("gitlab.com", 1, true)
+
local is_windows = fn.has('win32') == 1
revision = revision or repo.branch or "master"
- if can_use_tar and is_github_or_gitlab and not is_windows then
+ if can_use_tar and (is_github or is_gitlab) and not is_windows then
local path_sep = utils.get_path_sep()
local url = repo.url:gsub('.git$', '')
@@ -141,7 +143,7 @@ function M.select_download_commands(repo, project_name, cache_folder, revision)
opts = {
args = {
'-L', -- follow redirects
- is_github_or_gitlab and url.."/archive/"..revision..".tar.gz"
+ is_github and url.."/archive/"..revision..".tar.gz"
or url.."/-/archive/"..revision.."/"..project_name.."-"..revision..".tar.gz",
'--output',
project_name..".tar.gz"