1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

Put autojump's files in its own directory if $XDG_DATA_HOME is set.

This commit is contained in:
William Ting 2017-10-05 10:26:59 -07:00
parent b06d686bfe
commit 6a529f4f92

View File

@ -75,16 +75,9 @@ def set_defaults():
config = {} config = {}
if is_osx(): if is_osx():
data_home = os.path.join( data_home = os.path.join(os.path.expanduser('~'), 'Library')
os.path.expanduser('~'),
'Library',
'autojump',
)
elif is_windows(): elif is_windows():
data_home = os.path.join( data_home = os.getenv('APPDATA')
os.getenv('APPDATA'),
'autojump',
)
else: else:
data_home = os.getenv( data_home = os.getenv(
'XDG_DATA_HOME', 'XDG_DATA_HOME',
@ -92,12 +85,10 @@ def set_defaults():
os.path.expanduser('~'), os.path.expanduser('~'),
'.local', '.local',
'share', 'share',
'autojump',
), ),
) )
config['data_path'] = os.path.join(data_home, 'autojump', 'autojump.txt')
config['data_path'] = os.path.join(data_home, 'autojump.txt') config['backup_path'] = os.path.join(data_home, 'autojump', 'autojump.txt.bak')
config['backup_path'] = os.path.join(data_home, 'autojump.txt.bak')
return config return config