Skip to content

Instantly share code, notes, and snippets.

@ssboisen
Created September 25, 2012 07:16
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 ssboisen/3780423 to your computer and use it in GitHub Desktop.
Save ssboisen/3780423 to your computer and use it in GitHub Desktop.
#!/bin/sh
changedPackageFiles=$(git diff --cached --name-only | grep -i packages.config)
grepedCommitMessage=$(grep -i 'Update Packages' $1)
if [ -n "$changedPackageFiles" -a -z "$grepedCommitMessage" ]
then
echo "Aborting commit."
echo "Your changing the following packages.config files but you did not confirm this action:"
echo "$changedPackageFiles"
echo ""
echo "Unawarely updating NuGet-packages can introduce unforseen dependency management issues."
echo "If your sure you want to modify the packages.config files please include the text 'Update Packages' in the commit message"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment