mirror of
https://github.com/chenasraf/nvim-treesitter.git
synced 2026-05-17 17:38:02 +00:00
fix: install dependencies
This commit is contained in:
@@ -21,21 +21,12 @@ end)
|
||||
|
||||
-- check for new revisions
|
||||
for _, v in ipairs(sorted_parsers) do
|
||||
if skip_langs and not vim.list_contains(skip_langs, v.name) then
|
||||
local sha ---@type string
|
||||
if not vim.list_contains(skip_langs, v.name) and v.parser.install_info then
|
||||
local cmd = 'git ls-remote ' .. v.parser.install_info.url
|
||||
if v.parser.install_info.branch then
|
||||
sha = vim.split(
|
||||
vim.fn.systemlist(
|
||||
'git ls-remote '
|
||||
.. v.parser.install_info.url
|
||||
.. ' | grep refs/heads/'
|
||||
.. v.parser.install_info.branch
|
||||
)[1],
|
||||
'\t'
|
||||
)[1]
|
||||
else
|
||||
sha = vim.split(vim.fn.systemlist('git ls-remote ' .. v.parser.install_info.url)[1], '\t')[1]
|
||||
cmd = cmd .. ' | grep refs/heads/' .. v.parser.install_info.branch
|
||||
end
|
||||
local sha = vim.split(vim.fn.systemlist(cmd)[1], '\t')[1]
|
||||
lockfile[v.name] = { revision = sha }
|
||||
print(v.name .. ': ' .. sha)
|
||||
else
|
||||
@@ -43,5 +34,8 @@ for _, v in ipairs(sorted_parsers) do
|
||||
end
|
||||
end
|
||||
|
||||
lockfile = vim.fn.system('jq --sort-keys', vim.json.encode(lockfile))
|
||||
lockfile = vim.json.encode(lockfile)
|
||||
if vim.fn.executable('jq') == 1 then
|
||||
lockfile = vim.fn.system('jq --sort-keys', lockfile)
|
||||
end
|
||||
util.write_file(filename, lockfile)
|
||||
|
||||
@@ -23,14 +23,23 @@ local footnotes = ''
|
||||
for _, v in ipairs(sorted_parsers) do
|
||||
local p = v.parser
|
||||
-- language
|
||||
generated_text = generated_text
|
||||
.. '['
|
||||
.. v.name
|
||||
.. ']('
|
||||
.. p.install_info.url
|
||||
.. ')'
|
||||
.. (p.readme_note and '[^' .. v.name .. ']' or '')
|
||||
.. ' | '
|
||||
if p.install_info then
|
||||
generated_text = generated_text
|
||||
.. '['
|
||||
.. v.name
|
||||
.. ']('
|
||||
.. p.install_info.url
|
||||
.. ')'
|
||||
.. (p.readme_note and '[^' .. v.name .. ']' or '')
|
||||
.. ' | '
|
||||
else
|
||||
generated_text = generated_text
|
||||
.. v.name
|
||||
.. ' (queries only)'
|
||||
.. (p.readme_note and '[^' .. v.name .. ']' or '')
|
||||
.. ' | '
|
||||
end
|
||||
|
||||
if p.readme_note then
|
||||
footnotes = footnotes .. '[^' .. v.name .. ']: ' .. p.readme_note .. '\n'
|
||||
end
|
||||
@@ -50,11 +59,13 @@ for _, v in ipairs(sorted_parsers) do
|
||||
|
||||
-- CLI
|
||||
generated_text = generated_text
|
||||
.. (p.install_info.requires_generate_from_grammar and '✓' or '')
|
||||
.. (p.install_info and p.install_info.requires_generate_from_grammar and '✓' or '')
|
||||
.. ' | '
|
||||
|
||||
-- NPM
|
||||
generated_text = generated_text .. (p.install_info.generate_requires_npm and '✓' or '') .. ' | '
|
||||
generated_text = generated_text
|
||||
.. (p.install_info and p.install_info.generate_requires_npm and '✓' or '')
|
||||
.. ' | '
|
||||
|
||||
-- Maintainer
|
||||
generated_text = generated_text
|
||||
|
||||
Reference in New Issue
Block a user