Permalink
Browse files

Updated buildDocs.sh

  • Loading branch information...
1 parent 84772a4 commit f3f195fe4e8364f2571181555ef0b35e8c9fb5d2 @rozza rozza committed Jan 18, 2013
Showing with 32 additions and 2 deletions.
  1. +32 −2 buildDocs.sh
View
34 buildDocs.sh
@@ -1,4 +1,34 @@
#!/bin/sh
+usage()
+{
+cat << EOF
+usage: $0 options
+
+This script generates the casbah documentation
+
+OPTIONS:
+ -h Show this message
+ -g Auto update the gh-pages branch
+EOF
+}
+
+GHPAGES=false
+while getopts "h:g" OPTION
+do
+ case $OPTION in
+ h)
+ usage
+ exit 1
+ ;;
+ g)
+ GHPAGES=$OPTARG
+ ;;
+ ?)
+ usage
+ exit
+ ;;
+ esac
+done
SCALA=2.9.2
WEBSITE_ROOT=rozza.github.com/casbah/
@@ -30,7 +60,7 @@ make -C $SPHINX_DIR clean epub latexpdf
cp $SPHINX_DIR/_build/epub/CasbahMongoDBScalaToolkitDocumentation.epub $SITE_DIR/CasbahDocumentation.epub
cp $SPHINX_DIR/_build/latex/CasbahDocumentation.pdf $SITE_DIR/CasbahDocumentation.pdf
-if git diff-index --quiet HEAD --; then
+if $GHPAGES && git diff-index --quiet HEAD --; then
echo " ========================== "
echo " Updating `gh-pages` branch"
echo " ========================== "
@@ -42,7 +72,7 @@ if git diff-index --quiet HEAD --; then
mv .target target
echo " Please check the new docs and checkin ..."
-else
+elif $GHPAGES; then
echo "You have changes not checked-in - cannot automatically update gh-pages"
fi

0 comments on commit f3f195f

Please sign in to comment.