Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAndNotify ¶
CheckAndNotify performs a version check and notifies the user if a newer version is available. This is the main entry point for the version check system. The function is silent on all errors to avoid interrupting CLI operations.
Types ¶
type AutoUpdateAction ¶ added in v0.6.0
type AutoUpdateAction string
AutoUpdateAction describes the result of an update prompt.
func MaybeAutoUpdate ¶ added in v0.5.6
func MaybeAutoUpdate(ctx context.Context, w io.Writer, currentVersion, latestVersion string) AutoUpdateAction
MaybeAutoUpdate prints an update notification and offers an interactive upgrade. Silent on every failure path — it must never interrupt the CLI.
The same 3-option prompt (update / skip / skip until next version) is shown for every install manager that supports auto-installation (brew, mise, scoop, curl-bash). The only thing that varies between installers is the shell command interpolated into option 1.
If the installer command fails, a hint with the exact command is printed so the user can retry manually. The 24h version-check cache is not invalidated on failure: we don't want to re-prompt on every invocation while an upstream issue (network, auth, repo outage) is still in place.
When the prompt cannot be shown (kill switch set, or non-interactive environment like CI / agent subprocess / no TTY) the installer command is printed so the user still learns what to run manually.
On Windows + unknown install manager the POSIX curl-pipe-bash fallback can't auto-run and there's no native equivalent, so we point the user at the releases download page instead.
type GitHubRelease ¶
GitHubRelease represents the GitHub API response for a release.
type VersionCache ¶
type VersionCache struct {
LastCheckTime time.Time `json:"last_check_time"`
SkippedVersion string `json:"skipped_version,omitempty"`
}
VersionCache represents the cached version check data.