blob: 36be0b9c4aaadbfb5408fea8b53c11f39f8cc352 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/usr/bin/env -S nvim -l
local generate = false
local max_jobs = nil ---@as integer
local parsers = {}
for i = 1, #_G.arg do
if _G.arg[i] == '--generate' then
generate = true
elseif _G.arg[i]:find('^%-%-max%-jobs') then
max_jobs = _G.arg[i]:match('=(%d+)')
else
parsers[#parsers + 1] = _G.arg[i]
end
end
vim.opt.runtimepath:append('.')
-- needed on CI
vim.fn.mkdir(vim.fn.stdpath('cache'), 'p')
local ok = nil
require('nvim-treesitter.install').install(
#parsers > 0 and parsers or 'all',
{ force = true, generate = generate, max_jobs = max_jobs },
function(success)
ok = success
end
)
vim.wait(6000000, function()
return ok ~= nil
end)
if not ok then
vim.cmd.cq()
end
|