Pass --force to cargo-install

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-08-05 15:42:48 +10:00
parent 4b79abeedc
commit 34f714c64f
No known key found for this signature in database
GPG key ID: 591C0B03040416D6
3 changed files with 8 additions and 1 deletions

View file

@ -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()