Self-update for the standalone binary (ADR 0007), rustup/deno style:
resolve a release from the GitHub Releases API, download this
platform's asset, verify it against the release's SHA256SUMS, and
swap the running executable in place.
Only the Burrito binary can swap itself — it knows its own path via
__BURRITO_BIN_PATH. Everything up to the swap (the check/1 plan)
works anywhere, so mix users can still ask "am I current?".
Options
:version— a tag like"v0.1.0-rc.1"; defaults to the latest stable release (releases/latestnever returns prereleases).:api_base— GitHub API base URL, for tests and mirrors.:fetch—url -> {:ok, body} | {:error, reason}fetcher; defaults toCherry.Upgrade.HTTP.fetch/1.:bin_path— the executable to replace; defaults to__BURRITO_BIN_PATH(set by the Burrito wrapper).
Summary
Functions
The release asset this platform installs (cherry-linux-x86_64, …).
Pure mapping from OS/arch to the release asset name.
Resolves the target release and says whether an upgrade is due.
Runs the full upgrade: plan, download, verify, swap.
Types
Functions
@spec asset_name() :: String.t()
The release asset this platform installs (cherry-linux-x86_64, …).
Pure mapping from OS/arch to the release asset name.
@spec check([option()]) :: {:ok, Cherry.Upgrade.Plan.t()} | {:error, failure()}
Resolves the target release and says whether an upgrade is due.
@spec run([option()]) :: {:ok, %{ plan: Cherry.Upgrade.Plan.t(), swapped?: boolean(), retired: Path.t() | nil, path: Path.t() }} | {:error, failure()}
Runs the full upgrade: plan, download, verify, swap.
Returns the plan plus :swapped? (false when already up to date) and
:retired — the path of the previous executable when it could not be
deleted (Windows keeps the running image locked; the leftover is
harmless and reused by the next upgrade).