feat(brew): Add greedy-auto-updates option to Brew (#914)
This commit is contained in:
@@ -120,6 +120,12 @@
|
|||||||
# both of them, they won't clash with each other.
|
# both of them, they won't clash with each other.
|
||||||
# greedy_latest = true
|
# greedy_latest = true
|
||||||
|
|
||||||
|
# For the BrewCask step
|
||||||
|
# If `Repo Cask Upgrade` does not exist, then use the `--greedy_auto_updates` option.
|
||||||
|
# NOTE: the above entry `greedy_cask` contains this entry, though you can enable
|
||||||
|
# both of them, they won't clash with each other.
|
||||||
|
# greedy_auto_updates = true
|
||||||
|
|
||||||
# For the BrewFormula step
|
# For the BrewFormula step
|
||||||
# Execute `brew autoremove` after the step.
|
# Execute `brew autoremove` after the step.
|
||||||
# autoremove = true
|
# autoremove = true
|
||||||
@@ -254,7 +260,7 @@
|
|||||||
# runtime = "podman"
|
# runtime = "podman"
|
||||||
|
|
||||||
[lensfun]
|
[lensfun]
|
||||||
# If disabled, Topgrade invokes `lensfun‑update‑data` without root priviledge,
|
# If disabled, Topgrade invokes `lensfun‑update‑data` without root priviledge,
|
||||||
# then the update will be only available to you. Otherwise, `sudo` is required,
|
# then the update will be only available to you. Otherwise, `sudo` is required,
|
||||||
# and the update will be installed system-wide, i.e., available to all users.
|
# and the update will be installed system-wide, i.e., available to all users.
|
||||||
# (default: false)
|
# (default: false)
|
||||||
|
|||||||
@@ -271,6 +271,7 @@ pub struct Flatpak {
|
|||||||
pub struct Brew {
|
pub struct Brew {
|
||||||
greedy_cask: Option<bool>,
|
greedy_cask: Option<bool>,
|
||||||
greedy_latest: Option<bool>,
|
greedy_latest: Option<bool>,
|
||||||
|
greedy_auto_updates: Option<bool>,
|
||||||
autoremove: Option<bool>,
|
autoremove: Option<bool>,
|
||||||
fetch_head: Option<bool>,
|
fetch_head: Option<bool>,
|
||||||
}
|
}
|
||||||
@@ -1179,6 +1180,15 @@ impl Config {
|
|||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Whether Brew cask should be auto_updates
|
||||||
|
pub fn brew_greedy_auto_updates(&self) -> bool {
|
||||||
|
self.config_file
|
||||||
|
.brew
|
||||||
|
.as_ref()
|
||||||
|
.and_then(|c| c.greedy_auto_updates)
|
||||||
|
.unwrap_or(false)
|
||||||
|
}
|
||||||
|
|
||||||
/// Whether Brew should autoremove
|
/// Whether Brew should autoremove
|
||||||
pub fn brew_autoremove(&self) -> bool {
|
pub fn brew_autoremove(&self) -> bool {
|
||||||
self.config_file
|
self.config_file
|
||||||
|
|||||||
@@ -380,6 +380,9 @@ pub fn run_brew_cask(ctx: &ExecutionContext, variant: BrewVariant) -> Result<()>
|
|||||||
if ctx.config().brew_greedy_latest() {
|
if ctx.config().brew_greedy_latest() {
|
||||||
brew_args.push("--greedy-latest");
|
brew_args.push("--greedy-latest");
|
||||||
}
|
}
|
||||||
|
if ctx.config().brew_greedy_auto_updates() {
|
||||||
|
brew_args.push("--greedy-auto-updates");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
variant.execute(run_type).args(&brew_args).status_checked()?;
|
variant.execute(run_type).args(&brew_args).status_checked()?;
|
||||||
|
|||||||
Reference in New Issue
Block a user