Use the real path of the cache root

This commit is contained in:
Anthony Sottile 2020-05-08 13:38:35 -07:00
parent 450d617dec
commit 4c154c3019
2 changed files with 8 additions and 4 deletions

View file

@ -30,10 +30,11 @@ def _get_default_directory() -> str:
`Store.get_default_directory` can be mocked in tests and
`_get_default_directory` can be tested.
"""
return os.environ.get('PRE_COMMIT_HOME') or os.path.join(
ret = os.environ.get('PRE_COMMIT_HOME') or os.path.join(
os.environ.get('XDG_CACHE_HOME') or os.path.expanduser('~/.cache'),
'pre-commit',
)
return os.path.realpath(ret)
class Store: