From 2a073f760caf6b1611ce39815d2fdf66c6967147 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Fri, 1 Oct 2021 18:18:11 +0200 Subject: feat(install): add options `prefer_git` and `command_extra_args` Fixes #1888 --- lua/nvim-treesitter/shell_command_selectors.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lua/nvim-treesitter/shell_command_selectors.lua') diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua index fe727396..7acd91d2 100644 --- a/lua/nvim-treesitter/shell_command_selectors.lua +++ b/lua/nvim-treesitter/shell_command_selectors.lua @@ -121,16 +121,14 @@ function M.select_mv_cmd(from, to, cwd) end end -function M.select_download_commands(repo, project_name, cache_folder, revision) +function M.select_download_commands(repo, project_name, cache_folder, revision, prefer_git) local can_use_tar = vim.fn.executable "tar" == 1 and vim.fn.executable "curl" == 1 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 is_gitlab) and not is_windows then + if can_use_tar and (is_github or is_gitlab) and not prefer_git then local path_sep = utils.get_path_sep() local url = repo.url:gsub(".git$", "") -- cgit v1.2.3