aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lua/nvim-treesitter/install.lua4
-rwxr-xr-xscripts/install-parsers.lua3
2 files changed, 4 insertions, 3 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index 6d60b7921..e6933fe58 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -440,6 +440,10 @@ local function install(languages, options)
options = options or {}
local cache_dir = fs.normalize(fn.stdpath('cache'))
+ if not vim.uv.fs_stat(cache_dir) then
+ vim.fn.mkdir(cache_dir, 'p')
+ end
+
local install_dir = config.get_install_dir('parser')
local task_funs = {} ---@type async.TaskFun[]
diff --git a/scripts/install-parsers.lua b/scripts/install-parsers.lua
index f2fd56082..e3804cab8 100755
--- a/scripts/install-parsers.lua
+++ b/scripts/install-parsers.lua
@@ -18,9 +18,6 @@ end
vim.opt.runtimepath:append('.')
--- needed on CI
-vim.fn.mkdir(vim.fn.stdpath('cache'), 'p')
-
---@type async.Task
local task = update and require('nvim-treesitter').update('all')
or require('nvim-treesitter').install(