expanduser for non-default config locations

This commit is contained in:
Gil Forsyth 2016-10-01 12:19:11 -04:00
parent f77f2a4075
commit 4ef4f7570b

View file

@ -184,7 +184,7 @@ DEFAULT_TITLE = '{current_job:{} | }{user}@{hostname}: {cwd} | xonsh'
@default_value
def xonsh_data_dir(env):
"""Ensures and returns the $XONSH_DATA_DIR"""
xdd = os.path.join(env.get('XDG_DATA_HOME'), 'xonsh')
xdd = os.path.expanduser(os.path.join(env.get('XDG_DATA_HOME'), 'xonsh'))
os.makedirs(xdd, exist_ok=True)
return xdd
@ -192,7 +192,7 @@ def xonsh_data_dir(env):
@default_value
def xonsh_config_dir(env):
"""Ensures and returns the $XONSH_CONFIG_DIR"""
xcd = os.path.join(env.get('XDG_CONFIG_HOME'), 'xonsh')
xcd = os.path.expanduser(os.path.join(env.get('XDG_CONFIG_HOME'), 'xonsh'))
os.makedirs(xcd, exist_ok=True)
return xcd