mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Implement the clean command.
This commit is contained in:
parent
88dd5e46d5
commit
fa953d4c2d
3 changed files with 25 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ from __future__ import print_function
|
|||
|
||||
import os
|
||||
import pkg_resources
|
||||
import shutil
|
||||
import stat
|
||||
from plumbum import local
|
||||
|
||||
|
|
@ -117,3 +118,10 @@ def autoupdate(runner):
|
|||
)
|
||||
|
||||
return retv
|
||||
|
||||
|
||||
def clean(runner):
|
||||
if os.path.exists(runner.hooks_workspace_path):
|
||||
shutil.rmtree(runner.hooks_workspace_path)
|
||||
print('Cleaned {0}.'.format(runner.hooks_workspace_path))
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue