feat: a running lazysecrets says when a newer one was installed over it
CI / Checks (pull_request) Successful in 41s
PR title / Conventional title (pull_request) Successful in 1s

Every minute it looks whether its binary was replaced, from anywhere
(install.sh, go install, another lazysecrets): a stat, and the new
binary's --version when it changed. It shows → vX (restart), as after
U, so a long-running one (lazysecrets.nvim's) doesn't run an old
version unnoticed.
This commit is contained in:
keb committed 2026-10-19 21:30:18 +02:00
1 parent d0a8b1390d
commit d22e6fd7ac
7 files changed
+164 -1

No files matched your search

+7
View File
@@ -536,6 +536,7 @@ func (m Model) Init() tea.Cmd {
if m.fetchOnStart {
cmds = append(cmds, m.fetchLatest(false))
}
cmds = append(cmds, m.watchBinary())
if m.open != nil {
msg := openRefMsg{ref: *m.open, action: m.openAction}
cmds = append(cmds, func() tea.Msg { return msg })
@@ -600,6 +601,12 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case installedMsg:
m.handleInstalled(msg)
case binaryTickMsg:
cmds = append(cmds, m.lookAtBinary())
case replacedMsg:
cmds = append(cmds, m.handleReplaced(msg))
case currentMsg:
if msg.gen == m.sourcesGen {
m.current = &msg.source