mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 14:28:42 +00:00
Fix: Pass value of --roots
to cargo-install
as --root
(#860)
Pass value of `--roots` to `cargo-install` as `--root` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
9c7da6a179
commit
44e81c7e1a
3 changed files with 10 additions and 1 deletions
|
@ -53,8 +53,9 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) -
|
|||
.collect();
|
||||
|
||||
// Compute paths
|
||||
let cargo_root = args.roots;
|
||||
let (install_path, mut manifests, temp_dir) =
|
||||
compute_paths_and_load_manifests(args.roots, args.install_path)?;
|
||||
compute_paths_and_load_manifests(cargo_root.clone(), args.install_path)?;
|
||||
|
||||
// Remove installed crates
|
||||
let mut crate_names =
|
||||
|
@ -107,6 +108,8 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) -
|
|||
|
||||
temp_dir: temp_dir.path().to_owned(),
|
||||
install_path,
|
||||
cargo_root,
|
||||
|
||||
client,
|
||||
gh_api_client,
|
||||
jobserver_client,
|
||||
|
|
|
@ -32,6 +32,8 @@ pub struct Options {
|
|||
|
||||
pub temp_dir: PathBuf,
|
||||
pub install_path: PathBuf,
|
||||
pub cargo_root: Option<PathBuf>,
|
||||
|
||||
pub client: Client,
|
||||
pub gh_api_client: GhApiClient,
|
||||
pub jobserver_client: LazyJobserverClient,
|
||||
|
|
|
@ -154,6 +154,10 @@ impl ResolutionSource {
|
|||
cmd.arg("--locked");
|
||||
}
|
||||
|
||||
if let Some(cargo_root) = &opts.cargo_root {
|
||||
cmd.arg("--root").arg(cargo_root);
|
||||
}
|
||||
|
||||
if !opts.dry_run {
|
||||
let mut child = opts
|
||||
.jobserver_client
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue