updater

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CachedUpdateNotice

func CachedUpdateNotice(ds store.DataStore) string

CachedUpdateNotice returns a human-readable notice when a newer version is recorded in the cache. Returns "" when up to date, unknown, or disabled.

func CheckInBackground

func CheckInBackground(ds store.DataStore, enabled bool)

CheckInBackground fires a background goroutine to fetch the latest release from GitHub and cache it. It is a no-op when:

  • enabled is false (controlled by the updateCheck config field)
  • FLOW_NO_UPDATE_CHECK is set (CI / offline override)
  • the current binary has no known version (dev build)
  • the cached result is still fresh (< 24 h old)

Safe to call on every command invocation.

func IsDisabled

func IsDisabled() bool

IsDisabled returns true when update checks are suppressed via FLOW_NO_UPDATE_CHECK (any non-empty value other than "0" or "false").

func IsNewer

func IsNewer(current, latestTag string) bool

IsNewer returns true if latestTag is a higher semver than currentSemVer. latestTag may include a leading "v" (e.g. "v2.1.0").

func RefreshCache

func RefreshCache(ds store.DataStore, info *ReleaseInfo) error

RefreshCache stores release info in the data store with the current timestamp.

func Upgrade

func Upgrade(info *ReleaseInfo) error

Upgrade downloads and installs the release described by info. When flow was installed via Homebrew it delegates to `brew upgrade flow`; otherwise it downloads the matching GitHub release asset and replaces the running binary in-place.

Types

type ReleaseInfo

type ReleaseInfo struct {
	TagName   string    `json:"tag_name"`
	HTMLURL   string    `json:"html_url"`
	CheckedAt time.Time `json:"checked_at"`
}

ReleaseInfo holds metadata about a GitHub release fetched from the API.

func LatestRelease

func LatestRelease() (*ReleaseInfo, error)

LatestRelease fetches the latest release info from GitHub (live, not cached).

func ReleaseByTag

func ReleaseByTag(tag string) (*ReleaseInfo, error)

ReleaseByTag fetches a specific release by its tag (e.g. "v2.1.0"). A leading "v" is added automatically if omitted.

Jump to

Keyboard shortcuts

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