Documentation
¶
Index ¶
- func CachedLatestVersion(configDir, currentVersion string) string
- func FetchLatestCanaryVersion() (string, error)
- func FetchLatestVersionFresh() (string, error)
- func FetchLatestVersionFreshFor(currentVersion string) (string, error)
- func FetchReleaseNotes(version string) (string, error)
- func IsBeta(version string) bool
- func IsUpdateAvailable(current, latest string) bool
- func MarkVersionSeen(configDir, version string)
- func RunUpgrade(targetVersion string) error
- func ScheduleWhatsNew(configDir, newVersion string)
- func ShouldShowWhatsNew(configDir, currentVersion string) (bool, string)
- func UpgradeCommand(targetVersion string) (*exec.Cmd, error)
- type Release
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CachedLatestVersion ¶
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 ¶
FetchLatestCanaryVersion returns the most recent pre-release tag from GitHub. Returns an error if no pre-release exists.
func FetchLatestVersionFresh ¶
FetchLatestVersionFresh always fetches from GitHub API, bypassing the cache.
func FetchLatestVersionFreshFor ¶
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 ¶
FetchReleaseNotes fetches the release body for the given version tag from GitHub.
func IsUpdateAvailable ¶
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 ¶
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 ¶
ShouldShowWhatsNew returns (show, releaseNotes).
Two paths:
- 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.
- 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.
Types ¶
type Release ¶
Release bundles a version tag with its GitHub release body.
func CachedLatestRelease ¶
CachedLatestRelease returns the best available release (version + notes) for the given current version using a 24-hour disk cache.