mirror of
https://github.com/openSUSE/osc.git
synced 2025-09-07 13:48:43 +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:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user