aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2021-03-02 17:44:20 +0100
committerSantos Gallegos <stsewd@protonmail.com>2021-03-02 12:46:43 -0500
commit06660a73a78bb669caaa84338fc155f3f7e0059a (patch)
treec2a129c1f37513219758ad9a0517c01c5dc96a33
parentUpdate query parser (; in strings) (diff)
downloadnvim-treesitter-06660a73a78bb669caaa84338fc155f3f7e0059a.tar
nvim-treesitter-06660a73a78bb669caaa84338fc155f3f7e0059a.tar.gz
nvim-treesitter-06660a73a78bb669caaa84338fc155f3f7e0059a.tar.bz2
nvim-treesitter-06660a73a78bb669caaa84338fc155f3f7e0059a.tar.lz
nvim-treesitter-06660a73a78bb669caaa84338fc155f3f7e0059a.tar.xz
nvim-treesitter-06660a73a78bb669caaa84338fc155f3f7e0059a.tar.zst
nvim-treesitter-06660a73a78bb669caaa84338fc155f3f7e0059a.zip
Fix: Allow repo.url to end in ".git"
-rw-r--r--lua/nvim-treesitter/parsers.lua2
-rw-r--r--lua/nvim-treesitter/shell_command_selectors.lua7
2 files changed, 5 insertions, 4 deletions
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 506020b66..8ce9552f5 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -317,7 +317,7 @@ list.vue = {
list.jsonc = {
install_info = {
- url = "https://gitlab.com/WhyNotHugo/tree-sitter-jsonc",
+ url = "https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git",
files = { "src/parser.c" },
},
readme_name = "JSON with comments",
diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua
index bd5e9097b..65d266fb3 100644
--- a/lua/nvim-treesitter/shell_command_selectors.lua
+++ b/lua/nvim-treesitter/shell_command_selectors.lua
@@ -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')