mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-05 10:45:51 +00:00
Use XDG-Basedir as a fallback for configuration file location.
This commit is contained in:
parent
e40ba55bd3
commit
4c7042da56
1 changed files with 4 additions and 0 deletions
|
|
@ -273,6 +273,10 @@ def _create_app():
|
|||
if 'config' not in ctx.obj:
|
||||
fname = expand_path(os.environ.get('VDIRSYNCER_CONFIG',
|
||||
'~/.vdirsyncer/config'))
|
||||
if not os.path.exists(fname):
|
||||
xdg_config_dir = os.environ.get('XDG_CONFIG_HOME',
|
||||
expand_path('~/.config/'))
|
||||
fname = os.path.join(xdg_config_dir, 'vdirsyncer/config')
|
||||
try:
|
||||
ctx.obj['config'] = load_config(fname)
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Reference in a new issue