#! /bin/bash

set -o pipefail
set -e

if ! which firebase; then
   echo curl -sL https://firebase.tools | upgrade=true bash
fi

outdir=./deploy

rm -rf $outdir
mkdir -p $outdir/public
cp ./resume.md-main/resume.html $outdir/public/index.html
cp ./resume.md-main/resume.css $outdir/public/
cp ./resume.md-main/resume.pdf $outdir/public/

firebase login
echo firebase init
firebase deploy || (
   firebase logout
   firebase login
   firebase deploy
)
