Documentation
¶
Overview ¶
Package selfupdate lets the dodo-cli and dodo-tui binaries upgrade themselves in place from the project's GitHub releases: it compares the installed version against the latest release, and when a newer one exists it downloads the matching archive, verifies its checksum, and atomically replaces the running executable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisplayVersion ¶
DisplayVersion returns v, or "dev" when it is empty (an un-injected build).
Types ¶
type Options ¶
type Options struct {
CurrentVersion string // installed version, e.g. "v0.2.0" or "dev"
BinaryName string // "dodo-cli" or "dodo-tui"
Repo string // "owner/name"
APIBase string // GitHub API base URL
HTTPClient *http.Client
GOOS string
GOARCH string
ExePath string // executable to replace
}
Options configures an upgrade run. Zero-value fields fall back to sensible defaults: the real GitHub API, the running executable, and the host os/arch. The overridable fields exist so tests can point the whole flow at a local server and a temp file.
Click to show internal directories.
Click to hide internal directories.