#!/usr/bin/env bash

echo -e "\n== SANITY CHECK: GIT STATUS ==\n"
git status
echo -e "\nIs everything committed?  (Ctrl-C if not!) "
read

CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
rm -rf tmp tutorial/book
mdbook build tutorial
git switch gh-pages
mv -f tutorial/book/* .
git add -A
git commit -m "update tutorial"
git push origin HEAD
git switch $CURRENT_BRANCH
