Print error if not root

This commit is contained in:
ItsDrike 2020-10-22 19:58:49 +02:00
parent 4623175ea5
commit 7dc292d65a
No known key found for this signature in database
GPG key ID: F4E8FF4F6AC7F3B4

View file

@ -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()