Use an appropriate default config dir on OS X

This commit is contained in:
Kovid Goyal 2017-01-08 16:29:27 +05:30
parent 1b81971464
commit 089c6f25cd

View File

@ -30,7 +30,7 @@ def _get_config_dir():
if 'KITTY_CONFIG_DIRECTORY' in os.environ:
return os.path.abspath(os.path.expanduser(os.environ['VISE_CONFIG_DIRECTORY']))
candidate = os.path.abspath(os.path.expanduser(os.environ.get('XDG_CONFIG_HOME') or '~/.config'))
candidate = os.path.abspath(os.path.expanduser(os.environ.get('XDG_CONFIG_HOME') or ('~/Library/Preferences' if isosx else '~/.config')))
ans = os.path.join(candidate, appname)
try:
os.makedirs(ans)