summaryrefslogtreecommitdiff
path: root/flake8
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2014-05-05 21:34:21 +0200
committerFlorent Xicluna <florent.xicluna@gmail.com>2014-05-05 21:34:21 +0200
commit6c395673e29fdf446111f57bdfe215ac4f9760db (patch)
tree29e05845e8d2c99d5f44bb2721f945a2a43751a8 /flake8
parentd67491a104933b76a75610fac61f260b4fd771dc (diff)
downloadflake8-6c395673e29fdf446111f57bdfe215ac4f9760db.tar.gz
Do not overwrite Git pre-commit hook; closes #149
Diffstat (limited to 'flake8')
-rw-r--r--flake8/hooks.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/flake8/hooks.py b/flake8/hooks.py
index 289b66f..9542279 100644
--- a/flake8/hooks.py
+++ b/flake8/hooks.py
@@ -228,6 +228,8 @@ def install_hook():
status = 0
if 'git' in vcs:
+ if os.path.exists(vcs):
+ sys.exit('Error: hook already exists (%s)' % vcs)
with open(vcs, 'w') as fd:
fd.write(git_hook_file)
# rwxr--r--