Documentation
¶
Index ¶
- func Check(ctx context.Context, sink output.Sink, githubToken string) (string, bool, error)
- func CheckQuietly(ctx context.Context, githubToken string) (current, latest string, available bool)
- func NotifyUpdate(ctx context.Context, sink output.Sink, opts NotifyOptions) (exitAfter bool)
- func Update(ctx context.Context, sink output.Sink, checkOnly bool, githubToken string) error
- func WarnMultipleInstalls(sink output.Sink, getenv func(string) string)
- type Install
- type InstallInfo
- type InstallMethod
- type NotifyOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
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 NotifyUpdate ¶ added in v0.5.2
func WarnMultipleInstalls ¶ added in v0.18.0
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
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