diff --git a/src/__main__.py b/src/__main__.py index 28bece1..61a1ace 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -2,9 +2,19 @@ import os import sys from src.packages import install_packages +from src.util.user import Input, Print if os.geteuid() != 0: sys.exit("Please run this program as root user") -install_packages() + +def main(): + if Input.yes_no("Do you wish to perform package install (from `packages.yaml`)?"): + install_packages() + + +try: + main() +except KeyboardInterrupt: + Print.err("User cancelled (KeyboardInterrupt)") diff --git a/src/util/user.py b/src/util/user.py index 4188ac4..09baaaa 100644 --- a/src/util/user.py +++ b/src/util/user.py @@ -18,7 +18,7 @@ class Print: def err(text: str) -> None: """Print syntax for error""" - print(f"{Color.RED} !! {text}{Color.RESET}") + print(f"\n{Color.RED} !! {text}{Color.RESET}") def cancel(text: str) -> None: """Print syntax for cancellation"""