mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
feat(install): allow specifying max jobs
This commit is contained in:
parent
ab230eadd4
commit
83dae49a10
2 changed files with 7 additions and 3 deletions
|
|
@ -1,10 +1,13 @@
|
|||
#!/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
|
||||
|
|
@ -18,7 +21,7 @@ vim.fn.mkdir(vim.fn.stdpath('cache'), 'p')
|
|||
local done = false
|
||||
require('nvim-treesitter.install').install(
|
||||
#parsers > 0 and parsers or 'all',
|
||||
{ force = true, generate = generate },
|
||||
{ force = true, generate = generate, max_jobs = max_jobs },
|
||||
function()
|
||||
done = true
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue