fix: install dependencies

This commit is contained in:
Christian Clason
2023-05-31 09:19:16 +02:00
parent 9c0a99819c
commit cd2c826972
8 changed files with 207 additions and 131 deletions

View File

@@ -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)

View File

@@ -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