Skip to content

Instantly share code, notes, and snippets.

@bradfordcp
Created February 10, 2011 15:17
Show Gist options
  • Save bradfordcp/820681 to your computer and use it in GitHub Desktop.
Save bradfordcp/820681 to your computer and use it in GitHub Desktop.
Git pre-commit hook to generate documentation and add it to the commit, may be places within .git/hooks
#!/bin/sh
#
# Regenerates documentaion and adds it to the commite
#
# To enable this hook, rename this file to "pre-commit".
echo
echo "Regenerating Documentation"
echo
rake doc:generate
echo
echo
echo "Regeneration complete"
echo
echo "Adding updated docs to commit"
echo
git add docs
git add -u docs
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment