mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Add first pass at migration mode.
This commit is contained in:
parent
8f3f5c364a
commit
1d8394afd0
3 changed files with 153 additions and 37 deletions
|
|
@ -1,4 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
# This is a randomish md5 to identify this script
|
||||
# d8ee923c46731b42cd95cc869add4062
|
||||
|
||||
HERE=$(dirname $(readlink -f "$0"))
|
||||
|
||||
retv=0
|
||||
|
||||
which pre-commit > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
|
|
@ -6,4 +12,20 @@ if [ $? -ne 0 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Run the legacy pre-commit if it exists
|
||||
if [ -x "$HERE"/pre-commit.legacy ]; then
|
||||
"$HERE"/pre-commit.legacy
|
||||
if [ $? -ne 0 ]; then
|
||||
retv=1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Run pre-commit
|
||||
pre-commit
|
||||
if [ $? -ne 0 ]; then
|
||||
retv=1
|
||||
fi
|
||||
|
||||
exit $retv
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue