Add an install-hooks command (similar to install --install-hooks). Resolves #456

This commit is contained in:
Anthony Sottile 2017-01-04 07:52:16 -08:00
parent 8837cfa7ff
commit f238495d6b
4 changed files with 51 additions and 10 deletions

View file

@ -82,12 +82,16 @@ def install(runner, overwrite=False, hooks=False, hook_type='pre-commit'):
# If they requested we install all of the hooks, do so.
if hooks:
for repository in runner.repositories:
repository.require_installed()
install_hooks(runner)
return 0
def install_hooks(runner):
for repository in runner.repositories:
repository.require_installed()
def uninstall(runner, hook_type='pre-commit'):
"""Uninstall the pre-commit hooks."""
hook_path = runner.get_hook_path(hook_type)