Skip to main content

Module update

Module update 

Source
Expand description

mira update — replace this binary with a release from GitHub.

It does that by re-running the installer, not by re-implementing it. scripts/get-mira.sh already resolves the latest tag, picks the Rust target triple, verifies SHA256SUMS, verifies the build attestation when gh is present, and elevates only for the final move. Doing any of that from Rust needs an HTTPS client, and the smallest one worth trusting costs rustls plus ring plus their trees — against a dependency count the README publishes as a product property. Shelling out keeps that number where it is and keeps the installer singular: the same bytes that installed mira update it, so there is no second code path to be wrong by the next release.

There is no --check. The installer prints mira vX is already installed and stops when the version matches, so running it is the check, and a second network path that only prints would be a second thing to keep true.

The one thing this adds on top of the script is MIRA_INSTALL_DIR. The script defaults to /usr/local/bin; someone who put mira in ~/.local/bin and typed mira update means this mira, not a second copy that then shadows it depending on PATH order.

Constants§

INSTALLER 🔒
Where the installer is published. docs/install.sh is a symlink to scripts/get-mira.sh, so this URL and the one in the install docs are the same file.
RELEASES 🔒
Where to go when there is no shell to run the installer with.
USAGE

Functions§

command
The shell line that does the update.
install_dir
The directory to install into, given this process’s own executable path.
installer 🔒
The child, configured but not started.
parse
What --version was given, if anything.
run
Run it.
spawn 🔒
Start it and turn its exit into this command’s.
start_failed 🔒
What to say about a child that never started.