mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-17 16:16:37 +00:00
Add support to disable strategies via crate Cargo.toml
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
ac19952110
commit
f7643e1da1
6 changed files with 36 additions and 2 deletions
|
@ -73,6 +73,9 @@ pub struct PkgMeta {
|
|||
/// Package signing configuration
|
||||
pub signing: Option<PkgSigning>,
|
||||
|
||||
/// Stratgies to disable
|
||||
pub disabled_strategies: Option<Box<[Strategy]>>,
|
||||
|
||||
/// Target specific overrides
|
||||
pub overrides: BTreeMap<String, PkgOverride>,
|
||||
}
|
||||
|
@ -118,10 +121,16 @@ impl PkgMeta {
|
|||
.or_else(|| self.bin_dir.clone()),
|
||||
|
||||
signing: pkg_overrides
|
||||
.clone()
|
||||
.into_iter()
|
||||
.find_map(|pkg_override| pkg_override.signing.clone())
|
||||
.or_else(|| self.signing.clone()),
|
||||
|
||||
disabled_strategies: pkg_overrides
|
||||
.into_iter()
|
||||
.find_map(|pkg_override| pkg_override.disabled_strategies.clone())
|
||||
.or_else(|| self.disabled_strategies.clone()),
|
||||
|
||||
overrides: Default::default(),
|
||||
}
|
||||
}
|
||||
|
@ -142,6 +151,9 @@ pub struct PkgOverride {
|
|||
/// Path template override for binary files in packages
|
||||
pub bin_dir: Option<String>,
|
||||
|
||||
/// Stratgies to disable
|
||||
pub disabled_strategies: Option<Box<[Strategy]>>,
|
||||
|
||||
/// Package signing configuration
|
||||
pub signing: Option<PkgSigning>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue