1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-31 02:01:13 +00:00

#N/A: Support relative paths in cache decorator

This commit is contained in:
Vladimir Iakovlev 2017-08-30 15:05:44 +02:00
parent 503c903822
commit 96843fc6cd
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ class Fish(Generic):
'end').format(alias_name, alter_history) 'end').format(alias_name, alter_history)
@memoize @memoize
@cache('.config/fish/config.fish', '.config/fish/functions') @cache('~/.config/fish/config.fish', '~/.config/fish/functions')
def get_aliases(self): def get_aliases(self):
overridden = self._get_overridden_aliases() overridden = self._get_overridden_aliases()
proc = Popen(['fish', '-ic', 'functions'], stdout=PIPE, stderr=DEVNULL) proc = Popen(['fish', '-ic', 'functions'], stdout=PIPE, stderr=DEVNULL)

View File

@ -208,7 +208,7 @@ def cache(*depends_on):
""" """
def _get_mtime(name): def _get_mtime(name):
path = os.path.join(os.path.expanduser('~'), name) path = Path(name).expanduser().absolute().as_posix()
try: try:
return str(os.path.getmtime(path)) return str(os.path.getmtime(path))
except OSError: except OSError: