update

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package update provides version checking and self-update functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPeriodically

func CheckPeriodically(currentVersion string) string

CheckPeriodically checks for updates at most once per day. Returns a notice string if an update is available, empty string otherwise. This is designed to be called at the start of common commands.

func Update

func Update(currentVersion string) error

Update downloads and installs the latest version. Returns an error if installed via Homebrew (user should use brew upgrade).

func UpdateInstructions

func UpdateInstructions(method InstallMethod) string

UpdateInstructions returns instructions for updating based on install method.

Types

type InstallMethod

type InstallMethod int

InstallMethod represents how tk was installed.

const (
	// InstallUnknown means we couldn't determine the install method.
	InstallUnknown InstallMethod = iota
	// InstallHomebrew means tk was installed via Homebrew.
	InstallHomebrew
	// InstallScript means tk was installed via shell script or go install.
	InstallScript
)

func DetectInstallMethod

func DetectInstallMethod() InstallMethod

DetectInstallMethod determines how tk was installed by examining the binary path.

func (InstallMethod) String

func (m InstallMethod) String() string

type Release

type Release struct {
	Version     string
	ReleaseURL  string
	ReleaseDate string
}

Release represents information about a release.

func CheckForUpdate

func CheckForUpdate(currentVersion string) (*Release, bool, error)

CheckForUpdate checks if a newer version is available. Returns the latest release info and whether an update is available.

Jump to

Keyboard shortcuts

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