Expand description
§1bm: single binary manager
This is a CLI application. This documentation is for internal details. The crate is named onebm because Cargo doesn’t allow crate names starting with numbers.
All the metadata, downloaded binaries, and 1bm itself, are stored under ~/.local/1bm.
We intentionally don’t use standard directories
because we want to make it convenient to manually inspect and change things.
All downloaded binaries are under ~/.local/1bm/bin.
The user is asked to add it to PATH to use them.
Metadata are under ~/.local/1bm. Specifically:
- Installed binary list is at
~/.local/1bm/installed.json. It’s used to keep track of information like version, dist file, and name of each binary. - Dist files are at
~/.local/1bm/{FILE_HASH}.1bmdist. The hash is SHA-256 hex digest of the dist file and referenced in the installed binary list.
Structs§
- Binary
Meta - Metadata about a binary. Corresponds to one entry in
installed.json. - Dist
File - Corresponds to a dist file.
Enums§
Statics§
Functions§
- bin_
path - check_
update - Check if a binary should be updated. In addition to a bool, the new version is also returned.
- download
- Download binary and signature.
- ensure_
path - install_
binary - read_
binary_ list - read_
distfile - Read dist file from either local path or an URL.
- read_
distfile_ for_ binary - sha256
- timestamp_
now - uninstall_
binary - update_
binary - verify
- write_
binary_ list