mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-23 09:20:31 -06:00
Support --install-hooks as an option for pre-commit install
This commit is contained in:
@@ -35,6 +35,13 @@ def main(argv):
|
||||
'-f', '--overwrite', action='store_true',
|
||||
help='Overwrite existing hooks / remove migration mode.',
|
||||
)
|
||||
install_parser.add_argument(
|
||||
'--install-hooks', action='store_true',
|
||||
help=(
|
||||
'Whether to install hook environments for all environments '
|
||||
'in the config file.'
|
||||
),
|
||||
)
|
||||
|
||||
subparsers.add_parser('uninstall', help='Uninstall the pre-commit script.')
|
||||
|
||||
@@ -73,7 +80,9 @@ def main(argv):
|
||||
runner = Runner.create()
|
||||
|
||||
if args.command == 'install':
|
||||
return install(runner, overwrite=args.overwrite)
|
||||
return install(
|
||||
runner, overwrite=args.overwrite, hooks=args.install_hooks,
|
||||
)
|
||||
elif args.command == 'uninstall':
|
||||
return uninstall(runner)
|
||||
elif args.command == 'clean':
|
||||
|
||||
Reference in New Issue
Block a user