selfupgrade

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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