|
@@ -17,7 +17,7 @@ function plugin_loader.init(opts)
|
|
local core_plugins_dir = join_paths(get_lvim_base_dir(), "plugins")
|
|
local core_plugins_dir = join_paths(get_lvim_base_dir(), "plugins")
|
|
if utils.is_directory(core_plugins_dir) then
|
|
if utils.is_directory(core_plugins_dir) then
|
|
vim.fn.mkdir(plugins_dir, "p")
|
|
vim.fn.mkdir(plugins_dir, "p")
|
|
- vim.loop.fs_rmdir(plugins_dir)
|
|
|
|
|
|
+ vim.fn.delete(plugins_dir, "rf")
|
|
require("lvim.utils").fs_copy(core_plugins_dir, plugins_dir)
|
|
require("lvim.utils").fs_copy(core_plugins_dir, plugins_dir)
|
|
else
|
|
else
|
|
vim.fn.system {
|
|
vim.fn.system {
|
|
@@ -47,21 +47,22 @@ function plugin_loader.init(opts)
|
|
vim.opt.runtimepath:append(lazy_install_dir)
|
|
vim.opt.runtimepath:append(lazy_install_dir)
|
|
vim.opt.runtimepath:append(join_paths(plugins_dir, "*"))
|
|
vim.opt.runtimepath:append(join_paths(plugins_dir, "*"))
|
|
|
|
|
|
- local lazy_cache = require "lazy.core.cache"
|
|
|
|
- lazy_cache.setup {
|
|
|
|
- performance = {
|
|
|
|
- cache = {
|
|
|
|
- enabled = true,
|
|
|
|
- path = join_paths(get_cache_dir(), "lazy", "cache"),
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- }
|
|
|
|
- -- HACK: Don't allow lazy to call setup second time
|
|
|
|
- lazy_cache.setup = function() end
|
|
|
|
|
|
+ pcall(function()
|
|
|
|
+ -- set a custom path for lazy's cache and enable it
|
|
|
|
+ local lazy_cache = require "lazy.core.cache"
|
|
|
|
+ lazy_cache.path = join_paths(get_cache_dir(), "lazy", "luac")
|
|
|
|
+ lazy_cache.enable()
|
|
|
|
+ end)
|
|
end
|
|
end
|
|
|
|
|
|
function plugin_loader.reset_cache()
|
|
function plugin_loader.reset_cache()
|
|
- os.remove(require("lazy.core.cache").config.path)
|
|
|
|
|
|
+ -- TODO(kylo252): is this really necessary anymore?
|
|
|
|
+ local lazy_cache = require "lazy.core.cache"
|
|
|
|
+ local cache_path = lazy_cache.path
|
|
|
|
+ if utils.is_directory(cache_path) then
|
|
|
|
+ vim.fn.delete(cache_path, "rf")
|
|
|
|
+ vim.fn.mkdir(cache_path, "p")
|
|
|
|
+ end
|
|
end
|
|
end
|
|
|
|
|
|
function plugin_loader.reload(spec)
|
|
function plugin_loader.reload(spec)
|