#! /bin/bash

set -o pipefail
set -e

if ! which firebase; then
   f="$(mktemp)"
   curl -sL https://firebase.tools > "$f"
   export upgrade=true 
   sudo bash "$f"
fi

outdir=./deploy

rm -rf $outdir
mkdir -p $outdir/public
cp ./open-resume.com.d/resume.html.2 $outdir/public/index.html
cp ./open-resume.com.d/resume.pdf $outdir/public/BreeLaPointeResume.pdf
cp -r ./open-resume.com.d/fonts $outdir/public/

echo firebase uses squeaky2x3@gmail.com
firebase login
echo firebase init
firebase deploy || (
   firebase logout
   firebase login
   firebase deploy
)
