Skip to content

Commit

Permalink
Add documentation on how the files ubi installs end up being named
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Dec 25, 2024
1 parent 8adc59e commit fd6255b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,22 @@ for anonymous API requests.
However, you can also use the `--url` option to bypass the forge site API by providing the download
link directly.

## Installed Executable Naming

If the release is in the form of a tarball or zip file, `ubi` will look in that archive file for a
file that matches the value given for the `exe` field, if any. Otherwise it looks for a file with
the same name as the project. In either case, the file will be installed with the name it has in the
archive file.

If the release is in the form of a bare executable or a compressed executable, then the installed
executable will use the name of the project instead.

This is a bit inconsistent, but it's how `ubi` has behaved since it was created, and I find this to
be the sanest behavior. Some projects, for example `rust-analyzer`, provide releases as compressed
executables with names like `rust-analyzer-x86_64-apple-darwin.gz` and
`rust-analyzer-x86_64-unknown-linux-musl.gz`, so installing these as `rust-analyzer` seems like
better behavior.

## Upgrading `ubi`

You can run `ubi --self-upgrade` to upgrade `ubi` using `ubi`. Note that you must have write
Expand Down
16 changes: 16 additions & 0 deletions ubi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@
//! }
//! ```
//!
//! ## Installed Executable Naming
//!
//! If the release is in the form of a tarball or zip file, `ubi` will look in that archive file for
//! a file that matches the value given for the `exe` field, if any. Otherwise it looks for a file
//! with the same name as the project. In either case, the file will be installed with the name it
//! has in the archive file.
//
//! If the release is in the form of a bare executable or a compressed executable, then the installed
//! executable will use the name of the project instead.
//
//! This is a bit inconsistent, but it's how `ubi` has behaved since it was created, and I find this
//! to be the sanest behavior. Some projects, for example `rust-analyzer`, provide releases as
//! compressed executables with names like `rust-analyzer-x86_64-apple-darwin.gz` and
//! `rust-analyzer-x86_64-unknown-linux-musl.gz`, so installing these as `rust-analyzer` seems like
//! better behavior.
//!
//! ## Features
//!
//! This crate offers several features to control the TLS dependency used by `reqwest`:
Expand Down

0 comments on commit fd6255b

Please sign in to comment.