From 50aa9883275486abfe93c716c754d9e70fa527f3 Mon Sep 17 00:00:00 2001 From: Daniel Bendel Date: Thu, 15 Apr 2021 08:56:01 +0200 Subject: a little less variables :) --- lua/nvim-treesitter/shell_command_selectors.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lua') diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua index 6b76b3448..1d503603c 100644 --- a/lua/nvim-treesitter/shell_command_selectors.lua +++ b/lua/nvim-treesitter/shell_command_selectors.lua @@ -121,15 +121,13 @@ end function M.select_download_commands(repo, project_name, cache_folder, revision) - local has_tar = vim.fn.executable('tar') == 1 - local has_curl = 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 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_windows = fn.has('win32') == 1 revision = revision or repo.branch or "master" - if has_tar and has_curl and (is_github or is_gitlab) and not is_windows then + if can_use_tar and is_github_or_gitlab and not is_windows then local path_sep = utils.get_path_sep() local url = repo.url:gsub('.git$', '') -- cgit v1.2.3-70-g09d2