Documentation
¶
Overview ¶
Package selfupdate checks GitHub for a newer release and installs it by running the app's own installer (install.sh, or install.ps1 in PowerShell) with BIN_DIR set to the running binary's directory. The latest tag comes from the /releases/latest redirect, which avoids the rate-limited API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(ctx context.Context, repo string, info Info, binDir string, report func(string, ...any)) error
Apply installs info.LatestTag into binDir by running the platform installer with VERSION pinned, streaming its output to report. Replacing the running binary is safe: the installers stage in a temp dir, and on Windows the running .exe is renamed aside.
func BinDir ¶
BinDir is the running executable's directory, symlinks unresolved: a dev install is a symlink that the installer then replaces with the release binary.
func NewUpdateCommand ¶
NewUpdateCommand returns the shared `update` command: it compares the running version with repo's latest release and installs it in place. name is used in messages.