From 7dc292d65abfa76901dd7fb8cf5beb956b5c7f01 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 22 Oct 2020 19:58:49 +0200 Subject: [PATCH] Print error if not root --- src/__main__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/__main__.py b/src/__main__.py index 61a1ace..8d34a8a 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -1,15 +1,14 @@ 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") - - def main(): + if os.geteuid() != 0: + Print.err("You need to run this program as root user") + return + if Input.yes_no("Do you wish to perform package install (from `packages.yaml`)?"): install_packages()