#!/bin/bash
#copy this file to ESR-PDF branches

case "$(uname)" in
  Darwin) TARGETDIR="$HOME/Library/Application Support/typst/packages/local/esr-pdf-core/1.0.0" ;;
  Linux)  TARGETDIR="$HOME/.cache/typst/packages/local/esr-pdf-core/1.0.0" ;;
  *)      echo "Unsupported OS: $(uname)" && exit 1 ;;
esac &&

mkdir -p "$TARGETDIR" &&
cp -r icons "$TARGETDIR" &&
cp -r images "$TARGETDIR" &&
cp document-core.typ "$TARGETDIR/document-core.typ" &&
cp functions-core.typ "$TARGETDIR/functions-core.typ" &&
cp vars-core.typ "$TARGETDIR/vars-core.typ" &&
cp typst.toml "$TARGETDIR/typst.toml"
