aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/install-parsers.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/install-parsers.lua')
-rwxr-xr-xscripts/install-parsers.lua20
1 files changed, 17 insertions, 3 deletions
diff --git a/scripts/install-parsers.lua b/scripts/install-parsers.lua
index ab06e538f..c607e51f4 100755
--- a/scripts/install-parsers.lua
+++ b/scripts/install-parsers.lua
@@ -1,14 +1,28 @@
#!/usr/bin/env -S nvim -l
+local generate = false
+local parsers = {}
+for i = 1, #_G.arg do
+ if _G.arg[i] == '--generate' then
+ generate = true
+ 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 done = false
-require('nvim-treesitter.install').install('all', {}, function()
- done = true
-end)
+require('nvim-treesitter.install').install(
+ #parsers > 0 and parsers or 'all',
+ { force = true, generate = generate },
+ function()
+ done = true
+ end
+)
vim.wait(6000000, function()
return done