diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2023-05-31 09:19:16 +0200 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2025-05-12 18:43:40 +0200 |
| commit | cd2c826972f7bd6fd8f0c076fb9bfabe3f82209e (patch) | |
| tree | 4b29ae97fb9d7522766ace64bde404ae38facd8f /scripts/update-lockfile.lua | |
| parent | ci: remove update-lockfile shell script (diff) | |
| download | nvim-treesitter-cd2c826972f7bd6fd8f0c076fb9bfabe3f82209e.tar nvim-treesitter-cd2c826972f7bd6fd8f0c076fb9bfabe3f82209e.tar.gz nvim-treesitter-cd2c826972f7bd6fd8f0c076fb9bfabe3f82209e.tar.bz2 nvim-treesitter-cd2c826972f7bd6fd8f0c076fb9bfabe3f82209e.tar.lz nvim-treesitter-cd2c826972f7bd6fd8f0c076fb9bfabe3f82209e.tar.xz nvim-treesitter-cd2c826972f7bd6fd8f0c076fb9bfabe3f82209e.tar.zst nvim-treesitter-cd2c826972f7bd6fd8f0c076fb9bfabe3f82209e.zip | |
fix: install dependencies
Diffstat (limited to 'scripts/update-lockfile.lua')
| -rwxr-xr-x | scripts/update-lockfile.lua | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/scripts/update-lockfile.lua b/scripts/update-lockfile.lua index dfd3e933f..497f1bc0f 100755 --- a/scripts/update-lockfile.lua +++ b/scripts/update-lockfile.lua @@ -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) |
