mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-05 11:40:04 +00:00
Feature: Impl opt-out options (#510)
Fixed #136 * Impl opt-out optioins in binstalk * Replace field `Options::{gh_crate, quickinstall}_fetcher` with `resolver` which can determine order of resolver used. * Add new field `Args::{disable_}strategies` * Add new variant `BinstallError::InvalidStrategies` * Add variant `BinstallError::NoFallbackToCargoInstall` * Add code for supporting strategies in mod entry * Test `--disable-strategies` in `tests.sh` * Test for `--strategies` in `tests.sh` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
89fa5b1769
commit
9e80cf0700
6 changed files with 141 additions and 11 deletions
|
@ -1,14 +1,21 @@
|
|||
//! Concrete Binstall operations.
|
||||
|
||||
use std::path::PathBuf;
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
|
||||
use semver::VersionReq;
|
||||
|
||||
use crate::{manifests::cargo_toml_binstall::PkgOverride, DesiredTargets};
|
||||
use crate::{
|
||||
fetchers::{Data, Fetcher},
|
||||
helpers::remote::Client,
|
||||
manifests::cargo_toml_binstall::PkgOverride,
|
||||
DesiredTargets,
|
||||
};
|
||||
|
||||
pub mod install;
|
||||
pub mod resolve;
|
||||
|
||||
pub type Resolver = fn(&Client, &Arc<Data>) -> Arc<dyn Fetcher>;
|
||||
|
||||
pub struct Options {
|
||||
pub no_symlinks: bool,
|
||||
pub dry_run: bool,
|
||||
|
@ -18,4 +25,5 @@ pub struct Options {
|
|||
pub cli_overrides: PkgOverride,
|
||||
pub desired_targets: DesiredTargets,
|
||||
pub quiet: bool,
|
||||
pub resolver: Vec<Resolver>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue