Add field desired_targets to binstall::Options

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-07-21 15:05:12 +10:00
parent aa88dce215
commit 6a95bb07e0
No known key found for this signature in database
GPG key ID: 591C0B03040416D6
4 changed files with 6 additions and 11 deletions

View file

@ -11,7 +11,6 @@ use crate::{bins, fetchers::Fetcher, *};
pub async fn install(
resolution: Resolution,
opts: Arc<Options>,
desired_targets: DesiredTargets,
jobserver_client: LazyJobserverClient,
) -> Result<()> {
match resolution {
@ -32,7 +31,7 @@ pub async fn install(
install_from_package(fetcher, opts, cvs, version, bin_path, bin_files).await
}
Resolution::InstallFromSource { package } => {
let desired_targets = desired_targets.get().await;
let desired_targets = opts.desired_targets.get().await;
let target = desired_targets
.first()
.ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?;