mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 11:36:54 -04:00
Address #1067: check whether lockfile exists
This commit is contained in:
parent
123d2edfce
commit
88ac3d2365
1 changed files with 2 additions and 1 deletions
|
|
@ -33,7 +33,8 @@ end
|
|||
|
||||
local function get_revision(lang)
|
||||
if #lockfile == 0 then
|
||||
lockfile = vim.fn.json_decode(vim.fn.readfile(utils.join_path(utils.get_package_path(), 'lockfile.json')))
|
||||
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
|
||||
return (lockfile[lang] and lockfile[lang].revision)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue