mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-07 11:16:37 +00:00
Pass --force
to cargo-install
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
4b79abeedc
commit
34f714c64f
3 changed files with 8 additions and 1 deletions
|
@ -47,7 +47,7 @@ pub async fn install(
|
|||
.ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?;
|
||||
|
||||
if !opts.dry_run {
|
||||
install_from_source(package, target, jobserver_client, opts.quiet)
|
||||
install_from_source(package, target, jobserver_client, opts.quiet, opts.force)
|
||||
.await
|
||||
.map(|_| None)
|
||||
} else {
|
||||
|
@ -127,6 +127,7 @@ async fn install_from_source(
|
|||
target: &str,
|
||||
lazy_jobserver_client: LazyJobserverClient,
|
||||
quiet: bool,
|
||||
force: bool,
|
||||
) -> Result<()> {
|
||||
let jobserver_client = lazy_jobserver_client.get().await?;
|
||||
|
||||
|
@ -150,6 +151,10 @@ async fn install_from_source(
|
|||
cmd.arg("--quiet");
|
||||
}
|
||||
|
||||
if force {
|
||||
cmd.arg("--force");
|
||||
}
|
||||
|
||||
let mut child = cmd
|
||||
.spawn()
|
||||
.into_diagnostic()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue