#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "$0")"

echo "=== Cleaning study data ==="
for script in R/clean_study1.R R/clean_study2.R R/clean_study3.R; do
  echo "Running ${script}"
  Rscript "${script}"
done

echo "=== Rendering manuscript ==="
quarto render manuscript/manuscript.qmd --to pdf

echo "=== Rendering supplemental materials ==="
quarto render manuscript/supplementary_materials.qmd --to pdf

echo "=== Build complete ==="
