#!/usr/bin/env bash
set -euo pipefail
# Run from the checkout containing scripts/scenarios/script-command-hyphens.e2e.ts.
# APP_CHECKOUT selects the base or head checkout; both must have run vp i.
: "${APP_CHECKOUT:?Set APP_CHECKOUT to the checkout to exercise}"
proof_scratch=$(mktemp -d)
curl -L --fail https://raw.githubusercontent.com/JetBrains/JetBrainsMono/master/fonts/ttf/JetBrainsMono-Regular.ttf -o "$proof_scratch/JetBrainsMono-Regular.ttf"
cat > "$proof_scratch/fonts.conf" <<FONTCONFIG
<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"><fontconfig><include>/etc/fonts/fonts.conf</include><dir>$proof_scratch</dir><cachedir>$proof_scratch/font-cache</cachedir></fontconfig>
FONTCONFIG
T3CODE_DEV_SEED=0 FONTCONFIG_FILE="$proof_scratch/fonts.conf" T3_SCENARIO_APP_DIR="$APP_CHECKOUT" vp run scenarios scenarios/script-command-hyphens.e2e.ts --target web --output ".e2e/command-proof-$(date +%s)"
# Base intentionally exits 1 on the ligature assertion. Inspect the captures.
