Skip to content

Instantly share code, notes, and snippets.

@johannesberdin
Created October 8, 2018 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johannesberdin/436554f6e89f094b844cea9056e8d8a7 to your computer and use it in GitHub Desktop.
Save johannesberdin/436554f6e89f094b844cea9056e8d8a7 to your computer and use it in GitHub Desktop.
Warn on .spp files
#!/bin/sh
LIST=$(git diff --name-only --diff-filter=AM HEAD)
for file in $LIST
do
if [ "$file" == '#' ]; then
continue
fi
EXTENSION=$(echo "$file" | grep ".spp$")
if [ "$EXTENSION" != "" ]; then
echo "An error occured!"
echo
echo "You try to commit an .spp file."
echo "Please upload the .spp files to the NAS."
echo
echo "Can't commit, fix errors first."
echo
exit 1
fi
done
echo "Commited successfully."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment