mirror of
https://github.com/cheat/cheat.git
synced 2024-11-25 07:21:36 +01:00
Expand ~ for 'CHEAT_USER_DIR', 'CHEAT_DEFAULT_DIR' and 'DEFAULT_CHEAT_DIR'.
This commit is contained in:
parent
4dd55105d2
commit
5053f07fd8
@ -49,15 +49,14 @@ class Configuration:
|
|||||||
]).strip().lower()
|
]).strip().lower()
|
||||||
|
|
||||||
# self.cheat_user_dir
|
# self.cheat_user_dir
|
||||||
self.cheat_user_dir = self._select([
|
self.cheat_user_dir = self._select(
|
||||||
os.environ.get('CHEAT_USER_DIR'),
|
map(os.path.expanduser,
|
||||||
os.environ.get('CHEAT_DEFAULT_DIR'),
|
filter(None,
|
||||||
os.environ.get('DEFAULT_CHEAT_DIR'),
|
[os.environ.get('CHEAT_USER_DIR'),
|
||||||
# TODO: XDG home?
|
os.environ.get('CHEAT_DEFAULT_DIR'),
|
||||||
os.path.expanduser(
|
os.environ.get('DEFAULT_CHEAT_DIR'),
|
||||||
os.path.expandvars(os.path.join('~', '.cheat'))
|
# TODO: XDG home?
|
||||||
),
|
os.path.join('~', '.cheat')])))
|
||||||
])
|
|
||||||
|
|
||||||
# self.cheat_editor
|
# self.cheat_editor
|
||||||
self.cheat_editor = self._select([
|
self.cheat_editor = self._select([
|
||||||
|
Loading…
Reference in New Issue
Block a user