update

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SuggestedManualInstallScript = "curl -fsSL https://raw.githubusercontent.com/allisonhere/tide/main/install.sh | sh"

SuggestedManualInstallScript is shown when an update is available but the running binary's install directory is not writable (before any download/install attempt).

Variables

This section is empty.

Functions

func InstallDestinationWritable

func InstallDestinationWritable() (bool, error)

InstallDestinationWritable reports whether the directory containing the current executable allows creating files (same gate as in-place install).

func IsNewerVersion

func IsNewerVersion(latest, current string) bool

func IsStableVersion

func IsStableVersion(v string) bool

Types

type CheckResult

type CheckResult struct {
	CurrentVersion string
	Latest         ReleaseInfo
	Available      bool
}

CheckResult reports whether a newer stable release is available for the running version. -allie

type DownloadedAsset

type DownloadedAsset struct {
	Release     ReleaseInfo
	ArchivePath string
	BinaryPath  string
}

DownloadedAsset points at the extracted update payload staged for installation. -allie

type InstallResult

type InstallResult struct {
	Version        string
	ExecutablePath string
	RequiresManual bool
	ManualCommand  string
	Restartable    bool
}

InstallResult tells the UI whether Tide was replaced directly or needs a manual command. -allie

type ReleaseInfo

type ReleaseInfo struct {
	Version     string
	PublishedAt time.Time
	Summary     string
	Body        string
	AssetName   string
	DownloadURL string
}

ReleaseInfo is the normalized release and asset metadata the UI needs after a check. -allie

type Updater

type Updater struct {
	ReleasesURL string
	HTTPClient  *http.Client
	GOOS        string
	GOARCH      string
}

Updater checks GitHub releases and installs the asset matching the current platform. -allie

func New

func New() *Updater

func (*Updater) Check

func (u *Updater) Check(currentVersion string) (CheckResult, error)

func (*Updater) Download

func (u *Updater) Download(release ReleaseInfo) (DownloadedAsset, error)

func (*Updater) Install

func (u *Updater) Install(asset DownloadedAsset, currentExec string) (InstallResult, error)

Jump to

Keyboard shortcuts

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