set -e
base="$(dirname "$(readlink -f $0)")"
cd "$base"
cargo clean
cargo doc
cd target
git init
trap 'rm -rf .git/' 0
git add doc/
git commit -m 'Update documentation'
git remote add origin git@github.com:lfairy/rust-errno.git
git push --force origin master:gh-pages