Documentation
¶
Overview ¶
Package selfupdate wraps creativeprojects/go-selfupdate to update the vigil binary from its GitHub releases, with checksum validation. Channel detection and service stop/restart orchestration live with the caller (internal/cli).
Index ¶
Constants ¶
const Slug = "simtabi/vigil"
Slug is the GitHub owner/repo releases are pulled from.
Variables ¶
var ErrDevVersion = errors.New("this is a development build; self-update only works on released versions")
ErrDevVersion is returned when self-update is attempted on a dev build.
Functions ¶
func ExecutablePath ¶
ExecutablePath returns the resolved (symlink-followed) path of this binary, which is the file that will be replaced on update.
Types ¶
type Channel ¶
type Channel int
Channel is how the binary was installed, which determines whether in-place self-update is appropriate.
const ( // Standalone — installed via the install script, `vigil self install`, or a // downloaded release archive. Safe to self-update. Standalone Channel = iota // Homebrew — managed by `brew`. Homebrew // Scoop — managed by Scoop on Windows. Scoop // SystemPackage — installed via a Linux package manager (deb/rpm). SystemPackage )
func DetectChannel ¶
DetectChannel guesses the install channel from the executable path.
func (Channel) SelfUpdatable ¶
SelfUpdatable reports whether `vigil upgrade` should replace this binary.