mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-05-04 14:29:14 -05:00
Adhere to XDG specification for cache dir.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user