diff --git a/README.md b/README.md index 7292e4a..193ce5f 100644 --- a/README.md +++ b/README.md @@ -39,14 +39,11 @@ You can add the following Lua code to your `init.lua` to bootstrap **lazy.nvim** ```lua local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", + vim.fn.system({ "git", "clone", + "--filter=blob:none", "--depth=1", "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) + lazypath }) + vim.fn.system({ "git", "-C", lazypath, "checkout", "tags/stable" }) -- last stable release end vim.opt.rtp:prepend(lazypath) ``` diff --git a/lua/lazy/health.lua b/lua/lazy/health.lua index 38fa0ed..7943dd8 100644 --- a/lua/lazy/health.lua +++ b/lua/lazy/health.lua @@ -53,19 +53,23 @@ function M.check() end local spec = Config.spec - for _, plugin in pairs(spec.plugins) do - M.check_valid(plugin) - M.check_override(plugin) - end - if #spec.notifs > 0 then - error("Issues were reported when loading your specs:") - for _, notif in ipairs(spec.notifs) do - local lines = vim.split(notif.msg, "\n") - for _, line in ipairs(lines) do - if notif.level == vim.log.levels.ERROR then - error(line) - else - warn(line) + if spec == nil then + ok("no packages setup for installation so far.") + else + for _, plugin in pairs(spec.plugins) do + M.check_valid(plugin) + M.check_override(plugin) + end + if #spec.notifs > 0 then + error("Issues were reported when loading your specs:") + for _, notif in ipairs(spec.notifs) do + local lines = vim.split(notif.msg, "\n") + for _, line in ipairs(lines) do + if notif.level == vim.log.levels.ERROR then + error(line) + else + warn(line) + end end end end diff --git a/lua/lazy/init.lua b/lua/lazy/init.lua index 2b41ffd..aa6f430 100644 --- a/lua/lazy/init.lua +++ b/lua/lazy/init.lua @@ -96,14 +96,11 @@ end function M.bootstrap() local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", + vim.fn.system({ "git", "clone", + "--filter=blob:none", "--depth=1", "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) + lazypath }) + vim.fn.system({ "git", "-C", lazypath, "checkout", "tags/stable" }) -- last stable release end vim.opt.rtp:prepend(lazypath) end