selfupgrade

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHomebrewInstall added in v0.24.0

func IsHomebrewInstall(exePath string) bool

IsHomebrewInstall reports whether the running binary was installed via Homebrew by checking if exePath lives under a known Homebrew prefix.

func ResolveExecutablePath added in v0.24.0

func ResolveExecutablePath() string

ResolveExecutablePath returns the real path of the running binary, following symlinks. Returns an empty string on any error.

Types

type GithubUpdater

type GithubUpdater struct {
	// contains filtered or unexported fields
}

GithubUpdater checks for and applies CLI updates from GitHub releases.

func NewGitHubUpdater

func NewGitHubUpdater() (*GithubUpdater, error)

NewGitHubUpdater creates a GithubUpdater.

func (*GithubUpdater) DetectLatest

func (g *GithubUpdater) DetectLatest(ctx context.Context) (*ReleaseInfo, bool, error)

DetectLatest finds the latest release available.

func (*GithubUpdater) UpdateSelf added in v0.6.1

func (g *GithubUpdater) UpdateSelf(ctx context.Context, currentVersion string) (*ReleaseInfo, error)

UpdateSelf downloads and replaces the running binary with the latest release.

type ReleaseInfo

type ReleaseInfo struct {
	Release *goselfupdate.Release
	// contains filtered or unexported fields
}

ReleaseInfo wraps a go-selfupdate Release. version is used as a fallback when Release is nil (e.g. in test stubs).

func NewReleaseInfo added in v0.6.1

func NewReleaseInfo(version string) *ReleaseInfo

NewReleaseInfo creates a ReleaseInfo with only a version string, for use in tests.

func NewReleaseInfoFromSelfUpdate added in v0.6.1

func NewReleaseInfoFromSelfUpdate(rel *goselfupdate.Release) *ReleaseInfo

NewReleaseInfoFromSelfUpdate creates a ReleaseInfo from a selfupdate.Release object.

func (*ReleaseInfo) Equal added in v0.6.1

func (r *ReleaseInfo) Equal(version string) bool

Equal reports whether this release's version equals the given version string.

func (*ReleaseInfo) Version

func (r *ReleaseInfo) Version() string

Version returns the release version string.

Jump to

Keyboard shortcuts

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