mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
fix: expand user in the default dir for the store
fixes https://github.com/pre-commit/pre-commit/issues/2189
This commit is contained in:
parent
cccbc9d280
commit
79727b14bb
1 changed files with 3 additions and 2 deletions
|
|
@ -31,10 +31,11 @@ def _get_default_directory() -> str:
|
|||
`_get_default_directory` can be tested.
|
||||
"""
|
||||
ret = os.environ.get('PRE_COMMIT_HOME') or os.path.join(
|
||||
os.environ.get('XDG_CACHE_HOME') or os.path.expanduser('~/.cache'),
|
||||
os.environ.get('XDG_CACHE_HOME') or '~/.cache',
|
||||
'pre-commit',
|
||||
)
|
||||
return os.path.realpath(ret)
|
||||
|
||||
return os.path.realpath(os.path.expanduser(ret))
|
||||
|
||||
|
||||
class Store:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue