Finally squashed a directory bug, paths are set based on if you have root or not, and also are definable with a single arg

This commit is contained in:
Storm Dragon 2016-07-31 10:12:32 -04:00
parent ee954c468f
commit 326341f509

View File

@ -11,11 +11,13 @@ from xdg import BaseDirectory
# Get configuration directory
if len(sys.argv) > 1:
configPath = sys.argv[1]
else if os.geteuid() == 0:
elif os.geteuid() == 0:
# Save settings system wide
configPath = "/etc"
else
configPath = "/etc/fenrir.conf"
else:
# Use local settings
configPath = BaseDirectory.xdg_config_data + "/fenrir"
configPath = BaseDirectory.xdg_data_home + "/fenrir"
if not os.path.exists(configPath): os.makedirs(configPath)
configPath = configPath + "/fenrir.conf"