mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-10 05:50:02 +00:00
Support new cmdline option --roots
(#389)
* Add new field `Args::roots` * Use `env::var_os` to fetch `CARGO_INSTALL_ROOTS` Previously, it uses `env::var`, which might reject valid path just because it is not utf-8 string. * Update manifest if `CARGO_INSTALL_ROOT` is specified * Add new fn `install_path::get_cargo_roots_path` * Fix updating manifest: Use `cargo_roots` instead of default path * Rm `helpers::statics::cargo_home` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
a611b824fd
commit
934ccc257b
7 changed files with 67 additions and 38 deletions
|
@ -144,6 +144,19 @@ pub struct Args {
|
|||
#[clap(help_heading = "Options", long)]
|
||||
pub install_path: Option<PathBuf>,
|
||||
|
||||
/// Install binaries with a custom cargo root.
|
||||
///
|
||||
/// By default, we use `$CARGO_INSTALL_ROOT` or `$CARGO_HOME` as the
|
||||
/// cargo root and global metadata files are updated with the
|
||||
/// package information.
|
||||
///
|
||||
/// Specifying another path here would install the binaries and update
|
||||
/// the metadata files inside the path you specified.
|
||||
///
|
||||
/// NOTE that `--install-path` takes precedence over this option.
|
||||
#[clap(help_heading = "Options", long)]
|
||||
pub roots: Option<PathBuf>,
|
||||
|
||||
/// Deprecated, here for back-compat only. Secure is now on by default.
|
||||
#[clap(hide(true), long)]
|
||||
pub secure: bool,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue