#!/usr/bin/env bash
set -euo pipefail
# Run from each checkout before starting its dev server. All data is synthetic.
# EVIDENCE_DIR must point to the scratch directory containing fixture.mjs.
: "${EVIDENCE_DIR:?Set EVIDENCE_DIR}"
mkdir -p "$EVIDENCE_DIR/search-demo"
git init -q "$EVIDENCE_DIR/search-demo"
git -C "$EVIDENCE_DIR/search-demo" remote add origin https://github.com/example/search-demo.git
node apps/server/src/bin.ts project add "$EVIDENCE_DIR/search-demo" --title 'Search demo' --base-dir .t3
# The fixture replaces only external GitHub HTTP responses. The app/server/parser are unchanged.
T3CODE_DEV_SEED=0 GH_TOKEN=synthetic-evidence-token NODE_OPTIONS="--import=$EVIDENCE_DIR/fixture.mjs" vp run dev
