feat(winget): winget uses sudo when [windows] winget_use_sudo = true (#1061)

Co-authored-by: Gideon <87426140+GideonBear@users.noreply.github.com>
This commit is contained in:
Andreas Hoornstra
2025-07-15 09:12:55 +02:00
committed by GitHub
parent 23fff2a09f
commit 85c8bd2277
3 changed files with 35 additions and 1 deletions

View File

@@ -254,6 +254,7 @@ pub struct Windows {
wsl_update_pre_release: Option<bool>,
wsl_update_use_web_download: Option<bool>,
winget_silent_install: Option<bool>,
winget_use_sudo: Option<bool>,
}
#[derive(Deserialize, Default, Debug, Merge)]
@@ -1265,6 +1266,15 @@ impl Config {
.unwrap_or(false)
}
/// Should use sudo for Winget
pub fn winget_use_sudo(&self) -> bool {
self.config_file
.windows
.as_ref()
.and_then(|w| w.winget_use_sudo)
.unwrap_or(false)
}
/// Whether Brew cask should be greedy
pub fn brew_cask_greedy(&self) -> bool {
self.config_file