Skip to content

Instantly share code, notes, and snippets.

@axi92
Created June 29, 2023 08:21
Show Gist options
  • Save axi92/2e7f76cb7f4e7b65f046093b4e676b36 to your computer and use it in GitHub Desktop.
Save axi92/2e7f76cb7f4e7b65f046093b4e676b36 to your computer and use it in GitHub Desktop.
Check git for not allowed binaries
#!/bin/bash
# set -e
ERRORS=$(grep -rIL --exclude-dir=.git --exclude=*.png --exclude=*.jpg --exclude=*.crt --exclude=*.ttf . | wc -l)
if [ $ERRORS -gt "0" ]; then
echo '########################################'
echo 'Not allowed binaries are found in repo!'
echo 'Remove them:'
echo ''
grep -rIL --exclude-dir=.git --exclude=*.png --exclude=*.jpg --exclude=*.crt --exclude=*.ttf .
echo ''
echo '########################################'
exit 1;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment