updater

package
v1.38.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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 IsDev

func IsDev(version string) bool

IsDev reports whether the version looks like a dev build.

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

func SetAutoUpdate(enabled bool) error

SetAutoUpdate enables or disables automatic updates.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL