Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save freestream/8954807 to your computer and use it in GitHub Desktop.
Save freestream/8954807 to your computer and use it in GitHub Desktop.
#!/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