From 96843fc6cd7f487676b378371830d29ec0e7c083 Mon Sep 17 00:00:00 2001 From: Vladimir Iakovlev Date: Wed, 30 Aug 2017 15:05:44 +0200 Subject: [PATCH] #N/A: Support relative paths in cache decorator --- thefuck/shells/fish.py | 2 +- thefuck/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/thefuck/shells/fish.py b/thefuck/shells/fish.py index f0a1f4f3..538828d7 100644 --- a/thefuck/shells/fish.py +++ b/thefuck/shells/fish.py @@ -36,7 +36,7 @@ class Fish(Generic): 'end').format(alias_name, alter_history) @memoize - @cache('.config/fish/config.fish', '.config/fish/functions') + @cache('~/.config/fish/config.fish', '~/.config/fish/functions') def get_aliases(self): overridden = self._get_overridden_aliases() proc = Popen(['fish', '-ic', 'functions'], stdout=PIPE, stderr=DEVNULL) diff --git a/thefuck/utils.py b/thefuck/utils.py index ae56b963..60bc2f5c 100644 --- a/thefuck/utils.py +++ b/thefuck/utils.py @@ -208,7 +208,7 @@ def cache(*depends_on): """ def _get_mtime(name): - path = os.path.join(os.path.expanduser('~'), name) + path = Path(name).expanduser().absolute().as_posix() try: return str(os.path.getmtime(path)) except OSError: