Forked from drewdhunter/Magento - core code pre commit hook
Last active
November 8, 2017 08:50
-
-
Save freestream/8954807 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
declare -a file_patterns=('app/code/core' 'app/Mage.php$' '^index.php$') | |
exit_status=0 | |
while read x file; do | |
for file_pattern in ${file_patterns[@]}; do | |
if [[ $file =~ $file_pattern ]]; then | |
echo "Core change detected: $file" >&2 | |
exit_status=1 | |
fi | |
done | |
done < <(git diff --cached --name-status) | |
exit $exit_status; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment