#!/usr/bin/env bash
set -eu
# Args: checkout directory, new output directory, before|after
checkout=$1
output=$2
side=$3
mkdir -p "$output"
assets=$(cd -- "$(dirname -- "$0")" && pwd)
cd "$checkout"
# Run seed.py once with an empty fixture root, then run auth-server.py once.
# Add the matching fixture through the actual CLI:
# node apps/server/src/bin.ts project add --base-dir .t3 "$fixture_root/$side" --title 'Credential prompt reproduction'
# In the browser, pair using the startup URL, select Replay (dev) Showcase,
# select the synthetic project, and run browser-driver.mjs's capture sequence.
export T3CODE_DEV_SEED=0 GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1
export GIT_ASKPASS="$assets/askpass.py" EVIDENCE_ASKPASS_LOG="$output/$side-askpass.log"
vp run dev > "$output/$side-server.log" 2>&1
