From 61b0a05ec07280540d839aa9edfb81a84048fdf2 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 26 May 2025 14:42:03 +0200 Subject: [PATCH] fix(install): create cache dir if not existing --- lua/nvim-treesitter/install.lua | 4 ++++ scripts/install-parsers.lua | 3 --- 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(