mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Merge pull request #602 from pre-commit/xdg_cache_dir
Adhere to XDG specification for cache dir.
This commit is contained in:
commit
9ff6818270
9 changed files with 50 additions and 17 deletions
|
|
@ -8,7 +8,9 @@ from pre_commit.util import rmtree
|
|||
|
||||
|
||||
def clean(runner):
|
||||
if os.path.exists(runner.store.directory):
|
||||
rmtree(runner.store.directory)
|
||||
output.write_line('Cleaned {}.'.format(runner.store.directory))
|
||||
legacy_path = os.path.expanduser('~/.pre-commit')
|
||||
for directory in (runner.store.directory, legacy_path):
|
||||
if os.path.exists(directory):
|
||||
rmtree(directory)
|
||||
output.write_line('Cleaned {}.'.format(directory))
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue