Add upgrade bool to pass down via Options to fix #33

i18n
Michal S 2 years ago committed by Michal
parent 90787d329d
commit f90a2de51c

@ -20,4 +20,5 @@ impl Sorted {
pub struct Options {
pub noconfirm: bool,
pub asdeps: bool,
pub upgrade: bool,
}

@ -38,6 +38,7 @@ async fn main() {
let options = Options {
noconfirm,
asdeps: false,
upgrade: false,
};
if args.sudoloop {

@ -41,6 +41,7 @@ impl AurFetch {
if print_aur_package_list(&package_infos.iter().collect::<Vec<_>>()).await
&& !self.options.noconfirm
&& !self.options.upgrade
&& !prompt!(default yes, "Some packages are already installed. Continue anyway?")
{
return Err(AppError::UserCancellation);

@ -87,6 +87,10 @@ async fn upgrade_aur(options: Options) {
}
if !aur_upgrades.is_empty() {
let options = Options {
upgrade: true,
..options
};
aur_install(aur_upgrades, options).await;
} else {
tracing::info!("No upgrades available for installed AUR packages");

Loading…
Cancel
Save