diff options
Diffstat (limited to 'lua/lvim/bootstrap.lua')
| -rw-r--r-- | lua/lvim/bootstrap.lua | 25 | 
1 files changed, 10 insertions, 15 deletions
| diff --git a/lua/lvim/bootstrap.lua b/lua/lvim/bootstrap.lua index f637c144..5d980498 100644 --- a/lua/lvim/bootstrap.lua +++ b/lua/lvim/bootstrap.lua @@ -1,7 +1,7 @@  local M = {} -if vim.fn.has "nvim-0.7" ~= 1 then -  vim.notify("Please upgrade your Neovim base installation. Lunarvim requires v0.7+", vim.log.levels.WARN) +if vim.fn.has "nvim-0.8" ~= 1 then +  vim.notify("Please upgrade your Neovim base installation. Lunarvim requires v0.8+", vim.log.levels.WARN)    vim.wait(5000, function()      return false    end) @@ -19,15 +19,9 @@ function _G.join_paths(...)    return result  end ----Require a module in protected mode without relying on its cached value ----@param module string ----@return any -function _G.require_clean(module) -  package.loaded[module] = nil -  _G[module] = nil -  local _, requested = pcall(require, module) -  return requested -end +_G.require_clean = require("lvim.utils.modules").require_clean +_G.require_safe = require("lvim.utils.modules").require_safe +_G.reload = require("lvim.utils.modules").reload  ---Get the full path to `$LUNARVIM_RUNTIME_DIR`  ---@return string @@ -70,7 +64,7 @@ function M:init(base_dir)    self.packer_install_dir = join_paths(self.runtime_dir, "site", "pack", "packer", "start", "packer.nvim")    self.packer_cache_path = join_paths(self.config_dir, "plugin", "packer_compiled.lua") -  ---@meta overridden to use LUNARVIM_CACHE_DIR instead, since a lot of plugins call this function interally +  ---@meta overridden to use LUNARVIM_CACHE_DIR instead, since a lot of plugins call this function internally    ---NOTE: changes to "data" are currently unstable, see #2507    vim.fn.stdpath = function(what)      if what == "cache" then @@ -90,6 +84,7 @@ function M:init(base_dir)      vim.opt.rtp:remove(join_paths(vim.call("stdpath", "data"), "site"))      vim.opt.rtp:remove(join_paths(vim.call("stdpath", "data"), "site", "after"))      vim.opt.rtp:prepend(join_paths(self.runtime_dir, "site")) +    vim.opt.rtp:append(join_paths(self.runtime_dir, "lvim", "after"))      vim.opt.rtp:append(join_paths(self.runtime_dir, "site", "after"))      vim.opt.rtp:remove(vim.call("stdpath", "config")) @@ -120,10 +115,10 @@ end  ---Update LunarVim  ---pulls the latest changes from github and, resets the startup cache  function M:update() -  require_clean("lvim.utils.hooks").run_pre_update() -  local ret = require_clean("lvim.utils.git").update_base_lvim() +  reload("lvim.utils.hooks").run_pre_update() +  local ret = reload("lvim.utils.git").update_base_lvim()    if ret then -    require_clean("lvim.utils.hooks").run_post_update() +    reload("lvim.utils.hooks").run_post_update()    end  end | 
