mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +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:
|
if 'config' not in ctx.obj:
|
||||||
fname = expand_path(os.environ.get('VDIRSYNCER_CONFIG',
|
fname = expand_path(os.environ.get('VDIRSYNCER_CONFIG',
|
||||||
'~/.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:
|
try:
|
||||||
ctx.obj['config'] = load_config(fname)
|
ctx.obj['config'] = load_config(fname)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue