Documentation
¶
Index ¶
- func ApplyPendingUpdate(currentVersion string)
- func BackgroundCheck(currentVersion string)
- func IsAutoUpdateEnabled() bool
- func IsDev(version string) bool
- func NotifyIfUpdateAvailable(currentVersion string)
- func Run(currentVersion string)
- func RunBackgroundUpdate(currentVersion string)
- func SetAutoUpdate(enabled bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyPendingUpdate ¶ added in v1.7.0
func ApplyPendingUpdate(currentVersion string)
ApplyPendingUpdate checks for a pending update downloaded in a previous run. If found, replaces the current binary. The update takes effect on the next invocation. Only applies when auto-update is enabled. Cleans up stale pending files otherwise. Silent on all errors - never disrupts the current command.
func BackgroundCheck ¶ added in v1.7.0
func BackgroundCheck(currentVersion string)
BackgroundCheck spawns a detached subprocess to check for updates. When auto-update is on, the subprocess downloads the new binary. When auto-update is off, it only records the available version for a hint message. Silent on all errors - never disrupts command output.
func IsAutoUpdateEnabled ¶ added in v1.13.0
func IsAutoUpdateEnabled() bool
IsAutoUpdateEnabled reports whether automatic updates are turned on. Default is off — the flag file must be explicitly created.
func NotifyIfUpdateAvailable ¶ added in v1.13.0
func NotifyIfUpdateAvailable(currentVersion string)
NotifyIfUpdateAvailable prints a hint to stderr if a newer version is known. Called at startup when auto-update is off. Silent on all errors.
func Run ¶
func Run(currentVersion string)
Run checks for the latest version and updates the binary if needed.
func RunBackgroundUpdate ¶ added in v1.7.0
func RunBackgroundUpdate(currentVersion string)
RunBackgroundUpdate performs the version check and optionally downloads. When auto-update is on: checks version + downloads binary for next-run apply. When auto-update is off: checks version + records it so a hint is shown. Called by the subprocess spawned from BackgroundCheck — runs after parent exits.
func SetAutoUpdate ¶ added in v1.13.0
SetAutoUpdate enables or disables automatic updates.
Types ¶
This section is empty.