mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 11:36:54 -04:00
Fix: Allow repo.url to end in ".git"
This commit is contained in:
parent
c1a821b71f
commit
06660a73a7
2 changed files with 5 additions and 4 deletions
|
|
@ -117,6 +117,7 @@ function M.select_download_commands(repo, project_name, cache_folder, revision)
|
|||
|
||||
revision = revision or repo.branch or "master"
|
||||
local path_sep = utils.get_path_sep()
|
||||
local url = repo.url:gsub('.git$', '')
|
||||
|
||||
return {
|
||||
M.select_install_rm_cmd(cache_folder, project_name..'-tmp'),
|
||||
|
|
@ -127,8 +128,8 @@ function M.select_download_commands(repo, project_name, cache_folder, revision)
|
|||
opts = {
|
||||
args = {
|
||||
'-L', -- follow redirects
|
||||
is_github and repo.url.."/archive/"..revision..".tar.gz"
|
||||
or repo.url.."/-/archive/"..revision.."/"..project_name.."-"..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"
|
||||
},
|
||||
|
|
@ -151,7 +152,7 @@ function M.select_download_commands(repo, project_name, cache_folder, revision)
|
|||
},
|
||||
},
|
||||
M.select_rm_file_cmd(cache_folder..path_sep..project_name..".tar.gz"),
|
||||
M.select_mv_cmd(utils.join_path(project_name..'-tmp', repo.url:match('[^/]-$')..'-'..revision),
|
||||
M.select_mv_cmd(utils.join_path(project_name..'-tmp', url:match('[^/]-$')..'-'..revision),
|
||||
project_name,
|
||||
cache_folder),
|
||||
M.select_install_rm_cmd(cache_folder, project_name..'-tmp')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue