Last active
March 2, 2017 18:06
-
-
Save cdimartino/d0016f44dc73494bbe6184ac72373646 to your computer and use it in GitHub Desktop.
Yardoc git pre-commit hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Regenerates documentaion and adds it to the commit | |
# | |
# This file must live in .git/hooks/pre-commit and be executable | |
# | |
# Setup: | |
# | |
# cp pre-commit .git/hooks/ | |
# chmod +x .git/hooks/pre-commit | |
echo | |
echo "Regenerating Documentation" | |
echo | |
gem list | grep yard || gem install yard | |
yard -o docs --template-path ./.customtemplates | |
echo | |
echo | |
echo "Regeneration complete" | |
echo | |
echo "Adding updated docs to commit" | |
echo | |
git add -- docs .yardoc | |
git add -u -- docs .yardoc | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment