mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Add an install-hooks command (similar to install --install-hooks). Resolves #456
This commit is contained in:
parent
8837cfa7ff
commit
f238495d6b
4 changed files with 51 additions and 10 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue