#!/usr/bin/env bash

SCRIPT_DIR=$(dirname $(realpath $0))

for msk in *.msk; do
  TITLE="${msk%.msk}"
  rm -rf "$SCRIPT_DIR/.Books/unpacked/$TITLE"
  unzip -qou "$msk" -d "$SCRIPT_DIR/.Books/unpacked/$TITLE"
done

cd $SCRIPT_DIR && git add .
git commit -m "Saved at $(date)"
git push
