summaryrefslogtreecommitdiff
path: root/lua
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 /lua
parentc1a821b71f5561310511041116120b78b53633de (diff)
Fix: Allow repo.url to end in ".git"
Diffstat (limited to 'lua')
-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 506020b6..8ce9552f 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 bd5e9097..65d266fb 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')