mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Adhere to XDG specification for cache dir.
This commit is contained in:
parent
ef8347cf2d
commit
0120af56a7
9 changed files with 50 additions and 17 deletions
|
|
@ -29,9 +29,9 @@ def _get_default_directory():
|
|||
`Store.get_default_directory` can be mocked in tests and
|
||||
`_get_default_directory` can be tested.
|
||||
"""
|
||||
return os.environ.get(
|
||||
'PRE_COMMIT_HOME',
|
||||
os.path.join(os.path.expanduser('~'), '.pre-commit'),
|
||||
return os.environ.get('PRE_COMMIT_HOME') or os.path.join(
|
||||
os.environ.get('XDG_CACHE_HOME') or os.path.expanduser('~/.cache'),
|
||||
'pre-commit',
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue