Skip to main content

Module managed_install

Module managed_install 

Source
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 binary into <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 oxicode for the current user ($CARGO_HOME/bin/oxicode or the $HOME/.cargo/bin/oxicode default). 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’s managed_install).
version_from_version_output
Pull a bare MAJOR.MINOR.PATCH out of a --version banner (oxicode 0.79.0, oxicode 0.79.0 (commit…)).
version_of
Run <binary> --version and parse a bare version out.
versions_dir
Per-release binaries: <home>/versions/<v>/oxicode.