Expand description
Managed install layout — ~/.oxi/oxicode/{bin,versions}.
Mirrors the ecosystem binary standard that every Oxi app uses:
~/.oxi/<app>/bin/<app> is a launcher symlink to
../versions/<v>/<app>, with newer versions kept on disk and old
ones pruned. Oxicode’s fetch channel stays cargo install
(crates.io + binstall handle signing, prebuilt binaries, and the
platform matrix); handle_update
calls into this module after a successful cargo install so the
freshly-installed binary is adopted into the managed layout, the
launcher is flipped to it, and the cargo bin copy is repointed at
the launcher. The result: a single canonical binary under
~/.oxi/oxicode/versions/ and one symlink at every PATH entry.
Functions§
- adopt_
binary - Move
binaryinto<home>/versions/<version>/oxicode(atomic rename when on the same volume, copy+remove when crossing volumes), flip the launcher at<home>/bin/oxicode, optionally repoint a cargo/PATH copy at the launcher, and prune older version dirs (keep 2). Returns the launcher path. - cargo_
oxicode_ bin - Path of the cargo-installed
oxicodefor the current user ($CARGO_HOME/bin/oxicodeor the$HOME/.cargo/bin/oxicodedefault). May not exist; the caller decides. - launcher_
path - The launcher symlink PATH entries point at:
<home>/bin/oxicode. - parse_
version_ dir - Strict SemVer triple for version-dir names — no leading
v, no pre-release/build metadata (mirrors oxios’smanaged_install). - version_
from_ version_ output - Pull a bare
MAJOR.MINOR.PATCHout of a--versionbanner (oxicode 0.79.0,oxicode 0.79.0 (commit…)). - version_
of - Run
<binary> --versionand parse a bare version out. - versions_
dir - Per-release binaries:
<home>/versions/<v>/oxicode.