From 81ee02b8f69be2eabd670b8bcc423dba590821de Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 30 Dec 2022 09:17:46 +0100 Subject: [PATCH] feat(startup): missing plugins will now install the versions in the lockfile if available. Fixes #138 --- lua/lazy/core/loader.lua | 2 +- lua/lazy/manage/init.lua | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/lazy/core/loader.lua b/lua/lazy/core/loader.lua index f08a70c..70fc5a0 100644 --- a/lua/lazy/core/loader.lua +++ b/lua/lazy/core/loader.lua @@ -40,7 +40,7 @@ function M.setup() break end end - require("lazy.manage").install({ wait = true }) + require("lazy.manage").install({ wait = true, lockfile = true }) break end end diff --git a/lua/lazy/manage/init.lua b/lua/lazy/manage/init.lua index df30970..9b8c8ac 100644 --- a/lua/lazy/manage/init.lua +++ b/lua/lazy/manage/init.lua @@ -11,6 +11,7 @@ local M = {} ---@field mode? string ---@field plugins? (LazyPlugin|string)[] ---@field concurrency? number +---@field lockfile? boolean ---@param ropts RunnerOpts ---@param opts? ManagerOpts @@ -74,7 +75,7 @@ function M.install(opts) return M.run({ pipeline = { "git.clone", - "git.checkout", + { "git.checkout", lockfile = opts.lockfile }, "plugin.docs", "wait", "plugin.build", @@ -88,7 +89,7 @@ function M.install(opts) end) end ----@param opts? ManagerOpts|{lockfile?:boolean} +---@param opts? ManagerOpts function M.update(opts) opts = M.opts(opts, { mode = "update" }) return M.run({