From d8f75f0b093632159d825fdf84e0ea6dbf05cd75 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Thu, 10 Dec 2020 16:32:20 +0000 Subject: [docgen] Update README.md skip-checks: true --- lua/nvim-treesitter/install.lua | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'lua') diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index b1d1fc1fb..a34177e21 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -323,8 +323,11 @@ function M.uninstall(lang) end end -function M.write_lockfile(verbose) +function M.write_lockfile(verbose, skip_langs) local sorted_parsers = {} + -- Load previous lockfile + get_revision() + skip_langs = skip_langs or {} for k, v in pairs(parsers.get_parser_configs()) do table.insert(sorted_parsers, {name = k, parser = v}) @@ -333,11 +336,16 @@ function M.write_lockfile(verbose) table.sort(sorted_parsers, function(a, b) return a.name < b.name end) for _, v in ipairs(sorted_parsers) do - -- I'm sure this can be done in aync way with iter_cmd - local sha = vim.split(vim.fn.systemlist('git ls-remote '..v.parser.install_info.url)[1], '\t')[1] - lockfile[v.name] = { revision = sha } - if verbose then - print(v.name..': '..sha) + + if not vim.tbl_contains(skip_langs, v.name) then + -- I'm sure this can be done in aync way with iter_cmd + local sha = vim.split(vim.fn.systemlist('git ls-remote '..v.parser.install_info.url)[1], '\t')[1] + lockfile[v.name] = { revision = sha } + if verbose then + print(v.name..': '..sha) + end + else + print('Skipping '..v.name) end end -- cgit v1.2.3-70-g09d2