Ask before upgrading

This commit is contained in:
ItsDrike 2020-10-22 20:06:48 +02:00
parent f482a49a98
commit 06a94d87fd
No known key found for this signature in database
GPG key ID: F4E8FF4F6AC7F3B4

View file

@ -3,7 +3,7 @@ import yaml
from src.util.package import Package, PackageAlreadyInstalled, InvalidPackage from src.util.package import Package, PackageAlreadyInstalled, InvalidPackage
from src.util.install import Install from src.util.install import Install
from src.util.user import Print from src.util.user import Print, Input
def obtain_packages() -> t.List[Package]: def obtain_packages() -> t.List[Package]:
@ -27,7 +27,8 @@ def obtain_packages() -> t.List[Package]:
def install_packages() -> None: def install_packages() -> None:
packages = obtain_packages() packages = obtain_packages()
Install.upgrade_pacman() if Input.yes_no("Do you wish to perform system upgrade first? (Recommended)"):
Install.upgrade_pacman()
for package in packages: for package in packages:
try: try:
Print.action(f"Installing {package}") Print.action(f"Installing {package}")