Fix XDG_CONFIG_HOME check

This allows pkgcrap to fall back to ~/.config instead of crashing.
This commit is contained in:
Ryan Fox 2021-08-30 01:53:32 +00:00
parent 423ec61cad
commit bb152b2112
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@ import pkgcrap.parse as parse
def conf_dir_path():
conf_home = '~/.config'
if os.environ:
if 'XDG_CONFIG_HOME' in os.environ:
conf_home = os.environ['XDG_CONFIG_HOME']
if conf_home[0] == '~':
conf_home = os.environ['HOME']+'/'+conf_home[1:]