1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 01:06:17 +02:00

fix: XDG_CONFIG_HOME no longer used if empty

Previously, if XDG_CONFIG_HOME was defined as an empty string, it
was used. Now, if XDG_CONFIG_HOME is an empty string, `~/.config` is
used instead
This commit is contained in:
Edwin Kofler 2021-08-13 15:55:48 -07:00
parent a78a2f2df9
commit afd5b27196
No known key found for this signature in database
GPG Key ID: DA8EF6F306AD2CBA

View File

@ -1043,9 +1043,12 @@ def identify_conf():
if 'OSC_CONFIG' in os.environ:
return os.environ.get('OSC_CONFIG')
if os.path.exists(os.path.expanduser('~/.oscrc')):
conffile = '~/.oscrc'
return '~/.oscrc'
if os.environ.get('XDG_CONFIG_HOME', '') != '':
conffile = os.environ.get('XDG_CONFIG_HOME') + '/osc/oscrc'
else:
conffile = os.environ.get('XDG_CONFIG_HOME', '~/.config') + '/osc/oscrc'
conffile = '~/.config/osc/oscrc'
return conffile