mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-12 16:30:02 -04:00
CI: fix update lockfile job
Ref https://github.com/nvim-treesitter/nvim-treesitter/pull/1661#issuecomment-894722369
This commit is contained in:
parent
6ed86a8516
commit
70b43fbe21
1 changed files with 7 additions and 3 deletions
|
|
@ -58,10 +58,14 @@ local function get_parser_install_info(lang, validate)
|
||||||
return install_info
|
return install_info
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function load_lockfile()
|
||||||
|
local filename = utils.join_path(utils.get_package_path(), "lockfile.json")
|
||||||
|
lockfile = vim.fn.filereadable(filename) == 1 and vim.fn.json_decode(vim.fn.readfile(filename)) or {}
|
||||||
|
end
|
||||||
|
|
||||||
local function get_revision(lang)
|
local function get_revision(lang)
|
||||||
if #lockfile == 0 then
|
if #lockfile == 0 then
|
||||||
local filename = utils.join_path(utils.get_package_path(), "lockfile.json")
|
load_lockfile()
|
||||||
lockfile = vim.fn.filereadable(filename) == 1 and vim.fn.json_decode(vim.fn.readfile(filename)) or {}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local install_info = get_parser_install_info(lang)
|
local install_info = get_parser_install_info(lang)
|
||||||
|
|
@ -471,7 +475,7 @@ end
|
||||||
function M.write_lockfile(verbose, skip_langs)
|
function M.write_lockfile(verbose, skip_langs)
|
||||||
local sorted_parsers = {}
|
local sorted_parsers = {}
|
||||||
-- Load previous lockfile
|
-- Load previous lockfile
|
||||||
get_revision()
|
load_lockfile()
|
||||||
skip_langs = skip_langs or {}
|
skip_langs = skip_langs or {}
|
||||||
|
|
||||||
for k, v in pairs(parsers.get_parser_configs()) do
|
for k, v in pairs(parsers.get_parser_configs()) do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue