From 938e0f88bc3c27ce019470e0279233a373df61ef Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Tue, 21 Sep 2021 11:56:24 +0200 Subject: fix: remove outdated cache files on install (#1591) --- lua/impatient.lua | 2 +- utils/installer/install.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lua/impatient.lua b/lua/impatient.lua index ea1369fb..d438851c 100644 --- a/lua/impatient.lua +++ b/lua/impatient.lua @@ -277,7 +277,7 @@ impatient_dur = uv.hrtime() - impatient_load_start function M.setup(opts) opts = opts or {} - M.path = opts.path or vim.fn.stdpath "cache" .. "/luacache" + M.path = opts.path or vim.fn.stdpath "cache" .. "/lvim_cache" if opts.enable_profiling then M.enable_profile() diff --git a/utils/installer/install.sh b/utils/installer/install.sh index 52d36581..1bbb05c4 100755 --- a/utils/installer/install.sh +++ b/utils/installer/install.sh @@ -318,7 +318,23 @@ EOF chmod +x "$INSTALL_PREFIX/bin/lvim" } +function remove_old_cache_files() { + local packer_cache="$LUNARVIM_CONFIG_DIR/plugin/packer_compiled.lua" + if [ -e "$packer_cache" ]; then + echo "Removing old packer cache file" + rm -f "$packer_cache" + fi + + if [ -e "$LUNARVIM_CACHE_DIR/luacache" ] || [ -e "$LUNARVIM_CACHE_DIR/lvim_cache" ]; then + echo "Removing old startup cache file" + rm -f "$LUNARVIM_CACHE_DIR/{luacache,lvim_cache}" + fi +} + function setup_lvim() { + + remove_old_cache_files + echo "Installing LunarVim shim" setup_shim -- cgit v1.2.3