#!/bin/bash

# Taken from Celery (http://github.com/ask/celery)
# Written by Ask Solem Hoel <askh@opera.com>

git checkout master
(cd docs;
    rm -rf .build;
    make html;
    (cd .build/html;
        sphinxtogithub .;))
git checkout gh-pages
cp -r docs/.build/html/* .
git add .
git commit -m "Autogenerated documentation for github."
git push origin gh-pages
git checkout master