diff options
| author | Santos Gallegos <stsewd@protonmail.com> | 2021-08-07 19:27:18 -0500 |
|---|---|---|
| committer | Stephan Seitz <stephan.lauf@yahoo.de> | 2021-08-08 14:50:36 +0200 |
| commit | 70b43fbe21df514c5b248dc445483b7bdd7d24d4 (patch) | |
| tree | 05dc562c553cc171b76248d1c5e92e762cbbf8b6 | |
| parent | feat: allow 'revision' override in parser config (#1661) (diff) | |
| download | nvim-treesitter-70b43fbe21df514c5b248dc445483b7bdd7d24d4.tar nvim-treesitter-70b43fbe21df514c5b248dc445483b7bdd7d24d4.tar.gz nvim-treesitter-70b43fbe21df514c5b248dc445483b7bdd7d24d4.tar.bz2 nvim-treesitter-70b43fbe21df514c5b248dc445483b7bdd7d24d4.tar.lz nvim-treesitter-70b43fbe21df514c5b248dc445483b7bdd7d24d4.tar.xz nvim-treesitter-70b43fbe21df514c5b248dc445483b7bdd7d24d4.tar.zst nvim-treesitter-70b43fbe21df514c5b248dc445483b7bdd7d24d4.zip | |
CI: fix update lockfile job
Ref https://github.com/nvim-treesitter/nvim-treesitter/pull/1661#issuecomment-894722369
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 3bf5b2960..01bfef4d6 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -58,10 +58,14 @@ local function get_parser_install_info(lang, validate) return install_info 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) if #lockfile == 0 then - 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 {} + load_lockfile() end local install_info = get_parser_install_info(lang) @@ -471,7 +475,7 @@ end function M.write_lockfile(verbose, skip_langs) local sorted_parsers = {} -- Load previous lockfile - get_revision() + load_lockfile() skip_langs = skip_langs or {} for k, v in pairs(parsers.get_parser_configs()) do |
