Documentation
¶
Overview ¶
Package update implements `mp2rss update` self-updating the installed binary.
Flow:
- Query GitHub Releases API for the latest tag.
- Compare with the build-time injected version. --check exits here.
- Pick the platform archive (tar.gz / zip), download to a temp dir.
- Download checksums.txt and verify SHA-256.
- Extract the binary, stage it at <selfpath>.new, then os.Rename atomically.
- macOS only: strip the Gatekeeper quarantine xattr so the binary runs.
`os.Executable()` plus `filepath.EvalSymlinks` resolves the path so users installed via Homebrew / npm postinstall symlinks still get updated in place.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DownloadBase = func() string { return fmt.Sprintf("https://github.com/%s/releases/download", Repo) }
DownloadBase is overridable so tests can point at httptest servers.
View Source
var LatestReleaseURL = func() string { return fmt.Sprintf("https://api.github.com/repos/%s/releases/latest", Repo) }
LatestReleaseURL is overridable so tests can point at httptest servers.
View Source
var Repo = "areyoubugcoder/mp2rss-cli"
Repo is the GitHub slug we pull releases from. Exposed as a var so tests (and future enterprise builds) can repoint it.
Functions ¶
func LookupChecksum ¶
LookupChecksum returns the hex digest recorded in a `sha256sum`-style checksums.txt file for the given filename. Exposed for testing.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.