From 9dc3b285fa604b92ebf68ea32ddd99d6ea2460a7 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@pinebook-pro" <tfranken@protonmail.com> Date: Mon, 20 Apr 2020 09:46:14 +0200 Subject: [PATCH] Add condition function --- install.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install.py b/install.py index d025037..b36ba9e 100755 --- a/install.py +++ b/install.py @@ -207,6 +207,12 @@ class Installer: ui.info() +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 + + def main() -> None: """Parse args and instantiate the Installer."""