From aaf5b7fdf7664581601063f7804cff02e849525e Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 12 Oct 2024 20:14:21 +0200 Subject: fix(install): return error code in callback --- scripts/install-parsers.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/install-parsers.lua b/scripts/install-parsers.lua index 756d34561..36be0b9c4 100755 --- a/scripts/install-parsers.lua +++ b/scripts/install-parsers.lua @@ -18,15 +18,18 @@ vim.opt.runtimepath:append('.') -- needed on CI vim.fn.mkdir(vim.fn.stdpath('cache'), 'p') -local done = false +local ok = nil require('nvim-treesitter.install').install( #parsers > 0 and parsers or 'all', { force = true, generate = generate, max_jobs = max_jobs }, - function() - done = true + function(success) + ok = success end ) vim.wait(6000000, function() - return done + return ok ~= nil end) +if not ok then + vim.cmd.cq() +end -- cgit v1.2.3-70-g09d2