update

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DetectLatestFunc = DefaultDetectLatest

DetectLatestFunc is the injectable function used to check for a new release. Replace in tests to avoid hitting the GitHub API.

View Source
var HomebrewCheckerFunc = DefaultHomebrewChecker

HomebrewCheckerFunc is the injectable function used to detect Homebrew installs. Replace in tests to avoid touching the real filesystem.

Functions

func DefaultDetectLatest

func DefaultDetectLatest(slug string) (*selfupdate.Release, bool, error)

DefaultDetectLatest calls the real go-selfupdate API.

func DefaultHomebrewChecker

func DefaultHomebrewChecker() bool

DefaultHomebrewChecker is the real Homebrew detection using the current executable path.

func NewUpdateCmd

func NewUpdateCmd(f *cmdutil.Factory) *cobra.Command

NewUpdateCmd creates the `kh update` cobra command.

func TestableIsHomebrewInstall

func TestableIsHomebrewInstall(resolvedPath string) bool

TestableIsHomebrewInstall exposes the path-check logic for unit tests without touching the real filesystem. It accepts an already-resolved path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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