update

package
v0.18.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(ctx context.Context, sink output.Sink, githubToken string) (string, bool, error)

Check reports whether a newer version is available. Returns the latest version string and true if an update is available. Always emits exactly one UpdateCheckedEvent, whose DevBuild/Available fields tell the sink which of the three possible outcomes (dev build skipped / already up to date / an update is available) occurred.

func CheckQuietly added in v0.5.2

func CheckQuietly(ctx context.Context, githubToken string) (current, latest string, available bool)

func NotifyUpdate added in v0.5.2

func NotifyUpdate(ctx context.Context, sink output.Sink, opts NotifyOptions) (exitAfter bool)

func Update

func Update(ctx context.Context, sink output.Sink, checkOnly bool, githubToken string) error

Update checks for updates and applies the update if one is available.

func WarnMultipleInstalls added in v0.18.0

func WarnMultipleInstalls(sink output.Sink, getenv func(string) string)

WarnMultipleInstalls emits a warning when more than one distinct lstk install is present on PATH (e.g. an old Homebrew install shadowing a fresh npm one, so "lstk" keeps resolving to the stale binary).

Types

type Install added in v0.18.0

type Install struct {
	Path         string // location as found on PATH (what a shell would execute)
	ResolvedPath string // after symlink resolution
	Method       InstallMethod
	Running      bool // whether this entry is the currently running executable
}

Install describes one distinct lstk executable found on PATH.

func FindInstalls added in v0.18.0

func FindInstalls(getenv func(string) string) []Install

FindInstalls scans the directories in the PATH environment variable for lstk executables. Entries that resolve to the same file (symlinks, hardlinks, the same directory listed twice) are reported once. Results follow PATH order, so the first entry is the one a shell would execute.

type InstallInfo

type InstallInfo struct {
	Method       InstallMethod
	ResolvedPath string
}

InstallInfo holds the detected install method and the resolved binary path.

func DetectInstallMethod

func DetectInstallMethod() InstallInfo

DetectInstallMethod determines how lstk was installed by inspecting the resolved path of the running binary.

type InstallMethod

type InstallMethod int
const (
	InstallBinary   InstallMethod = iota // standalone binary download
	InstallHomebrew                      // installed via Homebrew cask
	InstallNPM                           // installed via npm
)

func (InstallMethod) String

func (m InstallMethod) String() string

type NotifyOptions added in v0.5.2

type NotifyOptions struct {
	GitHubToken        string
	UpdatePrompt       bool
	SkippedVersion     string
	PersistSkipVersion func(version string) error
}

Jump to

Keyboard shortcuts

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