version

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CachedLatestVersion

func CachedLatestVersion(configDir, currentVersion string) string

CachedLatestVersion returns the best available update for the given current version using a 24-hour disk cache. Beta builds only see newer -beta.N tags (channel-locked); stable builds check stable releases only.

func FetchLatestCanaryVersion

func FetchLatestCanaryVersion() (string, error)

FetchLatestCanaryVersion returns the most recent pre-release tag from GitHub. Returns an error if no pre-release exists.

func FetchLatestVersionFresh

func FetchLatestVersionFresh() (string, error)

FetchLatestVersionFresh always fetches from GitHub API, bypassing the cache.

func FetchLatestVersionFreshFor

func FetchLatestVersionFreshFor(currentVersion string) (string, error)

FetchLatestVersionFreshFor fetches the best available version for the given current version, bypassing the cache. Beta builds use the full releases list so users can discover newer betas; stable builds use the latest-release endpoint.

func FetchReleaseNotes

func FetchReleaseNotes(version string) (string, error)

FetchReleaseNotes fetches the release body for the given version tag from GitHub.

func IsBeta

func IsBeta(version string) bool

IsBeta reports whether version is a pre-release beta build.

func IsUpdateAvailable

func IsUpdateAvailable(current, latest string) bool

IsUpdateAvailable compares two semver strings, including beta versions. Returns false for dev/unversioned builds.

func MarkVersionSeen

func MarkVersionSeen(configDir, version string)

MarkVersionSeen writes the current version as "seen" so the splash won't show again.

func RunUpgrade

func RunUpgrade(targetVersion string) error

RunUpgrade downloads and runs the install script to upgrade to the given version.

func ScheduleWhatsNew

func ScheduleWhatsNew(configDir, newVersion string)

ScheduleWhatsNew writes a pending marker so the next launch always shows the What's New splash for newVersion, regardless of bump type. Call this before running the upgrade — not after.

func ShouldShowWhatsNew

func ShouldShowWhatsNew(configDir, currentVersion string) (bool, string)

ShouldShowWhatsNew returns (show, releaseNotes).

Two paths:

  1. Explicit upgrade: upgrade TUI writes a pending file before running the install script. On next launch the pending file is detected → always show, any version bump type.
  2. Auto-detection: first install (no seen file) or minor/major bump detected by comparing version-seen.txt to currentVersion.

Does NOT mark the version as seen — call MarkVersionSeen after user dismisses.

func UpgradeCommand

func UpgradeCommand(targetVersion string) (*exec.Cmd, error)

UpgradeCommand returns a configured exec.Cmd for upgrading to targetVersion.

Types

type Release

type Release struct {
	Version string
	Notes   string
}

Release bundles a version tag with its GitHub release body.

func CachedLatestRelease

func CachedLatestRelease(configDir, currentVersion string) Release

CachedLatestRelease returns the best available release (version + notes) for the given current version using a 24-hour disk cache.

Jump to

Keyboard shortcuts

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