diff --git a/install.py b/install.py index e11dfd2..74c296a 100755 --- a/install.py +++ b/install.py @@ -63,24 +63,22 @@ class Installer: this_stderr: Optional[int] = subprocess.DEVNULL if self.hide_commands else None if operating_system in ("arch", "manjaro"): - command = "sudo pacman -Syu" operating_system = "arch" + # On Arch-based systems, will update while installing packages elif operating_system in ("debian", "ubuntu"): - command = "sudo apt update" operating_system = "debian" + subprocess.run( + "sudo apt update", + check=True, + shell=True, + stdout=this_stdout, + stderr=this_stderr, + ) else: raise AssertionError("The operating system should have been defined") - subprocess.run( - command, - check=True, - shell=True, - stdout=this_stdout, - stderr=this_stderr, - ) - def evaluate_condition(self, condition: str) -> bool: """Run a bash command. On success return True, else return False.""" @@ -215,7 +213,7 @@ class Installer: ui.info_2("Installing packages...") for i, package in enumerate(packages): if self.operating_system == "arch": - command = "sudo pacman -S --needed --noconfirm {}".format(package) + command = "sudo pacman -Syu --needed --noconfirm {}".format(package) elif self.operating_system == "debian": command = "sudo apt install -y {}".format(package)