diff options
| author | Florent Xicluna <florent.xicluna@gmail.com> | 2014-05-05 21:34:21 +0200 |
|---|---|---|
| committer | Florent Xicluna <florent.xicluna@gmail.com> | 2014-05-05 21:34:21 +0200 |
| commit | 6c395673e29fdf446111f57bdfe215ac4f9760db (patch) | |
| tree | 29e05845e8d2c99d5f44bb2721f945a2a43751a8 /flake8/hooks.py | |
| parent | d67491a104933b76a75610fac61f260b4fd771dc (diff) | |
| download | flake8-6c395673e29fdf446111f57bdfe215ac4f9760db.tar.gz | |
Do not overwrite Git pre-commit hook; closes #149
Diffstat (limited to 'flake8/hooks.py')
| -rw-r--r-- | flake8/hooks.py | 2 |
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-- |
