#!/bin/bash
# Creates a ZIP archive of all important files and uploads
# it via scp. You are prompted for the exact path and
# need to extract the archive on the server afterwards.

dirname=latex-wochenende-$(date +"%Y%m%d%H%M%S")

echo "Compiling all slides …"
python3 ./onpoint/main.py -i -f .

echo "Creating zip file …"
mkdir $dirname
mkdir $dirname/css
mkdir $dirname/onpoint
for i in css/latex.css css/print images slides.de.html slides.en.html js onpoint/onpoint.js lib svg; do
  cp -r $i $dirname/$i
done;

(zip -r $dirname.zip $dirname) 1> /dev/null
rm -rf $dirname

echo -n "Enter scp destination: "
read destination
scp $dirname.zip $destination
rm $dirname.zip
