versioncheck

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndNotify

func CheckAndNotify(ctx context.Context, w io.Writer, currentVersion string)

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.

func UpdateCommandForCurrentBinary added in v0.7.8

func UpdateCommandForCurrentBinary(currentVersion string) string

UpdateCommandForCurrentBinary returns the shell command that updates this binary, based on how it was installed.

The fallback receives the exec path as the OS reports it (not normalized), so the Windows installer hint can name the directory the binary lives in.

func UpdateCommandShell added in v0.10.6

func UpdateCommandShell() string

UpdateCommandShell names the shell UpdateCommandForCurrentBinary's command has to run in, or "" when any shell will do. Callers that print the command instead of running it need it: the Windows commands are PowerShell one-liners, and pasting one into cmd.exe or bash either fails or, in bash's case, expands part of the command before PowerShell sees it.

Types

type AutoUpdateAction added in v0.6.0

type AutoUpdateAction string

AutoUpdateAction describes the result of an update prompt.

type GitHubRelease

type GitHubRelease struct {
	TagName    string `json:"tag_name"`
	Prerelease bool   `json:"prerelease"`
}

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.

Jump to

Keyboard shortcuts

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