Skip to content

Commit

Permalink
Generalize tools/publish-doc.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
woodbri committed Sep 18, 2013
1 parent e27d1ab commit 0c62eb0
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions tools/publish-doc.sh
Expand Up @@ -5,6 +5,11 @@
#
# Publish Documentation
# ------------------------------------------------------------------------------
if test a$1 = a ; then
echo "Usage: publish-doc.sh dir"
echo " where dir might be dev or v2.0"
exit 1
fi

VERSION=`git describe --tags --long`
BRANCH=`git branch | grep '*' | awk '{print $2}'`
Expand All @@ -15,18 +20,19 @@ if test ! -d build ; then
fi

# Switch branch
git checkout gh-pages && rm -Rf dev
git checkout gh-pages && rm -Rf "$1"

# Copy files and directories
mkdir dev
cp -R build/doc/html/en dev/en
mkdir "$1"
cp -R build/doc/html/en "$1"/en
cp build/doc/html/index.html .
cp build/doc/latex/en/pgRoutingDocumentation.pdf dev/en/
gzip -c build/doc/man/en/pgrouting.7 > dev/en/pgrouting.7.gz
cp build/doc/latex/en/pgRoutingDocumentation.pdf "$1"/en/
gzip -c build/doc/man/en/pgrouting.7 > "$1"/en/pgrouting.7.gz

# Commit changes
git add dev
git commit -m "updated to commit $VERSION" . && git push origin gh-pages
git add "$1"
git add index.html
git commit -m "Updated to commit $VERSION" . && git push origin gh-pages

# Switch branch
git checkout $BRANCH

0 comments on commit 0c62eb0

Please sign in to comment.