Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c695ee9

Browse files
committed
Move printing inside the commands for install and uninstall
1 parent 2f1454b commit c695ee9

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

pre_commit/commands.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
from __future__ import print_function
3+
24
import os
35
import pkg_resources
46
import stat
@@ -15,11 +17,15 @@ def install(runner):
1517
runner.pre_commit_path,
1618
original_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH,
1719
)
20+
21+
print('pre-commit installed at {0}'.format(runner.pre_commit_path))
22+
1823
return 0
1924

2025

2126
def uninstall(runner):
2227
"""Uninstall the pre-commit hooks."""
2328
if os.path.exists(runner.pre_commit_path):
2429
os.remove(runner.pre_commit_path)
30+
print('pre-commit uninstalled')
2531
return 0

pre_commit/run.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,9 @@ def run(argv):
127127
runner = Runner.create()
128128

129129
if args.command == 'install':
130-
retval = commands.install(runner)
131-
print 'pre-commit installed at {0}'.format(runner.pre_commit_path)
132-
return retval
130+
return commands.install(runner)
133131
elif args.command == 'uninstall':
134-
retval = commands.uninstall(runner)
135-
print 'pre-commit uninstalled'
136-
return retval
132+
return commands.uninstall(runner)
137133
elif args.command == 'run':
138134
if args.hook:
139135
return run_single_hook(runner, args.hook, all_files=args.all_files)

0 commit comments

Comments
 (0)