diff --git a/install.py b/install.py index b36ba9e..925eb39 100755 --- a/install.py +++ b/install.py @@ -89,9 +89,12 @@ class Installer: if executable: p_dest.chmod(0o755) - def do_run(self, command: str) -> None: + def do_run(self, *, command: str, condition: str = 'true') -> None: """Run a command.""" + if not evaluate_condition(condition): + return + ui.info_2("Running", "`{}`".format(command)) subprocess.run(command, check=True, shell=True) self.base_dir.chdir() @@ -210,7 +213,7 @@ class Installer: def evaluate_condition(command: str) -> bool: """Run a bash command. On success return True, else return False.""" - return subprocess.run(command, shell=True).returncode == 0 + return subprocess.run(command, check=False, shell=True).returncode == 0 def main() -> None: