Update git hooks

Add check to pre-commit hook to skip on Windows, where it is currently
partially broken
Notify user when hooks are run to replace similar shared-git-hooks
functionality
This commit is contained in:
Rummskartoffel 2020-11-26 22:22:08 +01:00
parent b988738c31
commit a366cddf11
3 changed files with 13 additions and 0 deletions

View file

@ -2,6 +2,8 @@
# stolen from https://gist.github.com/sindresorhus/7996717 # stolen from https://gist.github.com/sindresorhus/7996717
echo "Running post-checkout hook..."
changed_files="$(git diff-tree -r --name-only --no-commit-id $1 $2)" changed_files="$(git diff-tree -r --name-only --no-commit-id $1 $2)"

View file

@ -2,6 +2,8 @@
# stolen from https://gist.github.com/sindresorhus/7996717 # stolen from https://gist.github.com/sindresorhus/7996717
echo "Running post-merge hook..."
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"

View file

@ -1,5 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
case $(uname) in
*CYGWIN*|*MINGW*|*MSYS*)
echo "Cygwin/MinGW/MSYS detected, skipping pre-commit hook"
exit 0
;;
esac
echo "Running pre-commit hook..."
source ./scripts/common.sh source ./scripts/common.sh
jsfiles=$(cachedTSLintFiles) jsfiles=$(cachedTSLintFiles)