Add root running protection

This commit is contained in:
leha-code 2022-08-05 10:57:23 -04:00
parent 807fb8b245
commit 115ab433cc
No known key found for this signature in database
GPG Key ID: 15227A6455DDF7EE
1 changed files with 3 additions and 0 deletions

View File

@ -86,6 +86,9 @@ dark_stylesheet = qdarktheme.load_stylesheet()
USER = os.getenv("USER") # Get the username, used for later
if USER == 'root':
raise Exception("Don't run Planet as root.")
# Create the mods directory if it does not exist
if not os.path.exists(f"/home/{USER}/.planet-launcher/mods"):
os.makedirs(f"/home/{USER}/.planet-launcher/mods")