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:
parent
503c903822
commit
96843fc6cd
@ -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)
|
||||||
|
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user