feat: a running lazysecrets says when a newer one was installed over it
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:
7 files changed
+164
-1
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user