Documentation
¶
Overview ¶
Package upgrade implements self-updating from GitHub releases.
Index ¶
- func AssetName(tag string) string
- func AssetURL(tag, name string) string
- func CurrentExecutable() (string, error)
- func Download(ctx context.Context, url string) (string, error)
- func ExtractBinary(archivePath string) (string, error)
- func IsHomebrew(exe string) bool
- func LatestTag(ctx context.Context) (string, error)
- func Replace(exe, newBin string) error
- func Verify(ctx context.Context, archivePath, assetName, checksumsURL string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentExecutable ¶
CurrentExecutable resolves the real path of the running binary.
func ExtractBinary ¶
ExtractBinary pulls the chunder executable out of the release archive into a temp file and returns its path.
func IsHomebrew ¶
IsHomebrew reports whether the binary lives in a Homebrew cellar, where brew should manage upgrades instead of us.
func LatestTag ¶
LatestTag resolves the newest release tag by following GitHub's releases/latest redirect. Unlike the REST API, this is not rate-limited, so it works from shared IPs without a token.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.