mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-28 11:24:14 +00:00
feat: check outdated pinned plugins
This commit is contained in:
parent
c6d4613837
commit
67cdcf97b1
5 changed files with 17 additions and 1 deletions
|
@ -409,6 +409,7 @@ return {
|
||||||
concurrency = nil, ---@type number? set to 1 to check for updates very slowly
|
concurrency = nil, ---@type number? set to 1 to check for updates very slowly
|
||||||
notify = true, -- get a notification when new updates are found
|
notify = true, -- get a notification when new updates are found
|
||||||
frequency = 3600, -- check for updates every hour
|
frequency = 3600, -- check for updates every hour
|
||||||
|
check_pinned = false, -- check for pinned packages that can't be updated
|
||||||
},
|
},
|
||||||
change_detection = {
|
change_detection = {
|
||||||
-- automatically check for config file changes and reload the ui
|
-- automatically check for config file changes and reload the ui
|
||||||
|
|
|
@ -119,6 +119,7 @@ M.defaults = {
|
||||||
concurrency = nil, ---@type number? set to 1 to check for updates very slowly
|
concurrency = nil, ---@type number? set to 1 to check for updates very slowly
|
||||||
notify = true, -- get a notification when new updates are found
|
notify = true, -- get a notification when new updates are found
|
||||||
frequency = 3600, -- check for updates every hour
|
frequency = 3600, -- check for updates every hour
|
||||||
|
check_pinned = false, -- check for pinned packages that can't be updated
|
||||||
},
|
},
|
||||||
change_detection = {
|
change_detection = {
|
||||||
-- automatically check for config file changes and reload the ui
|
-- automatically check for config file changes and reload the ui
|
||||||
|
|
|
@ -42,7 +42,14 @@ M.log = {
|
||||||
error("no target commit found")
|
error("no target commit found")
|
||||||
end
|
end
|
||||||
assert(target.commit, self.plugin.name .. " " .. target.branch)
|
assert(target.commit, self.plugin.name .. " " .. target.branch)
|
||||||
if not Git.eq(info, target) then
|
if Git.eq(info, target) then
|
||||||
|
if Config.options.checker.check_pinned then
|
||||||
|
local last_commit = Git.get_commit(self.plugin.dir, target.branch, true)
|
||||||
|
if not Git.eq(info, { commit = last_commit }) then
|
||||||
|
self.plugin._.outdated = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
self.plugin._.updates = { from = info, to = target }
|
self.plugin._.updates = { from = info, to = target }
|
||||||
end
|
end
|
||||||
table.insert(args, info.commit .. ".." .. target.commit)
|
table.insert(args, info.commit .. ".." .. target.commit)
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
---@field is_local? boolean
|
---@field is_local? boolean
|
||||||
---@field updates? {from:GitInfo, to:GitInfo}
|
---@field updates? {from:GitInfo, to:GitInfo}
|
||||||
---@field cloned? boolean
|
---@field cloned? boolean
|
||||||
|
---@field outdated? boolean
|
||||||
---@field kind? LazyPluginKind
|
---@field kind? LazyPluginKind
|
||||||
---@field dep? boolean True if this plugin is only in the spec as a dependency
|
---@field dep? boolean True if this plugin is only in the spec as a dependency
|
||||||
---@field cond? boolean
|
---@field cond? boolean
|
||||||
|
|
|
@ -88,6 +88,12 @@ return {
|
||||||
end,
|
end,
|
||||||
title = "Not Installed",
|
title = "Not Installed",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
filter = function (plugin)
|
||||||
|
return plugin._.outdated
|
||||||
|
end,
|
||||||
|
title = "Outdated",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
filter = function(plugin)
|
filter = function(plugin)
|
||||||
return plugin._.loaded ~= nil
|
return plugin._.loaded ~= nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue