Uninstall restores hooks.

This commit is contained in:
Anthony Sottile
2014-06-16 17:48:56 -07:00
parent f4d16b9cdc
commit 0cde0fdc48
2 changed files with 25 additions and 0 deletions

View File

@@ -61,4 +61,9 @@ def uninstall(runner):
if os.path.exists(runner.pre_commit_path):
os.remove(runner.pre_commit_path)
print('pre-commit uninstalled')
if os.path.exists(runner.pre_commit_legacy_path):
os.rename(runner.pre_commit_legacy_path, runner.pre_commit_path)
print('Restored previous hooks to {0}'.format(runner.pre_commit_path))
return 0