diff --git a/src/internal/structs.rs b/src/internal/structs.rs index 9c3f075..d91df00 100644 --- a/src/internal/structs.rs +++ b/src/internal/structs.rs @@ -20,4 +20,5 @@ impl Sorted { pub struct Options { pub noconfirm: bool, pub asdeps: bool, + pub upgrade: bool, } diff --git a/src/main.rs b/src/main.rs index ef79041..e1622aa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,6 +38,7 @@ async fn main() { let options = Options { noconfirm, asdeps: false, + upgrade: false, }; if args.sudoloop { diff --git a/src/operations/aur_install/aur_fetch.rs b/src/operations/aur_install/aur_fetch.rs index ba708f2..1fd8d5b 100644 --- a/src/operations/aur_install/aur_fetch.rs +++ b/src/operations/aur_install/aur_fetch.rs @@ -41,6 +41,7 @@ impl AurFetch { if print_aur_package_list(&package_infos.iter().collect::>()).await && !self.options.noconfirm + && !self.options.upgrade && !prompt!(default yes, "Some packages are already installed. Continue anyway?") { return Err(AppError::UserCancellation); diff --git a/src/operations/upgrade.rs b/src/operations/upgrade.rs index 8d330fa..873a4c8 100644 --- a/src/operations/upgrade.rs +++ b/src/operations/upgrade.rs @@ -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");