#!/usr/bin/env sh set -eu REPO_ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) if command -v typst >/dev/null 2>&1; then TYPST=typst else echo "Typst CLI was not found in PATH." >&2 exit 1 fi find "$REPO_ROOT/publishing" -type f -name '*.typ' | sort | while IFS= read -r file; do output="${file%.typ}.pdf" echo "Compiling $file" "$TYPST" compile --root "$REPO_ROOT" "$file" "$output" done