mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-29 11:49:12 -05:00
clean: separate store from runner
This commit is contained in:
@@ -7,9 +7,9 @@ from pre_commit import output
|
||||
from pre_commit.util import rmtree
|
||||
|
||||
|
||||
def clean(runner):
|
||||
def clean(store):
|
||||
legacy_path = os.path.expanduser('~/.pre-commit')
|
||||
for directory in (runner.store.directory, legacy_path):
|
||||
for directory in (store.directory, legacy_path):
|
||||
if os.path.exists(directory):
|
||||
rmtree(directory)
|
||||
output.write_line('Cleaned {}.'.format(directory))
|
||||
|
||||
+1
-1
@@ -243,7 +243,7 @@ def main(argv=None):
|
||||
elif args.command == 'uninstall':
|
||||
return uninstall(runner, hook_type=args.hook_type)
|
||||
elif args.command == 'clean':
|
||||
return clean(runner)
|
||||
return clean(runner.store)
|
||||
elif args.command == 'autoupdate':
|
||||
if args.tags_only:
|
||||
logger.warning('--tags-only is the default')
|
||||
|
||||
Reference in New Issue
Block a user