look for cfg file in ~/.local as well

This commit is contained in:
Marcus Stoegbauer 2019-08-15 12:16:52 +08:00
parent ee30935983
commit 55829ad298
1 changed files with 7 additions and 2 deletions

View File

@ -195,8 +195,13 @@ def process_all_files(destfiles, dir_config):
debug.debug(" ================ process_all_files ===============", 1)
def main():
configfile = os.environ['HOME']+"/etc/userconfig.cfg"
configfile_destinations = [os.environ['HOME'] + "/etc/",
os.environ['HOME'] + "/.local/etc"]
configfile = ''
for directory in configfile_destinations:
if os.path.isfile(directory + "/userconfig.cfg"):
configfile = directory + "/userconfig.cfg"
break
try:
try:
opts, args = getopt.getopt(sys.argv[1:], "hdc:v", ["help", "debug", "config="])