From 326341f509554b1797d1fed70d0f2b489e496986 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 31 Jul 2016 10:12:32 -0400 Subject: [PATCH] Finally squashed a directory bug, paths are set based on if you have root or not, and also are definable with a single arg --- src/fenrir-package/utils/fenrir-config.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/fenrir-package/utils/fenrir-config.py b/src/fenrir-package/utils/fenrir-config.py index f3f0e5b7..d512ba67 100644 --- a/src/fenrir-package/utils/fenrir-config.py +++ b/src/fenrir-package/utils/fenrir-config.py @@ -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"