#!/usr/bin/env bash # Apply a list of rounds IN ORDER to a throwaway copy of the live tree, to find # anchor collisions between rounds authored in parallel — before any of them # costs a twenty-minute ship cycle. # bash preflight.sh 20 21 22 23 24 25 26 set -u S="C:/Users/Kyle/AppData/Local/Temp/claude/F--Coding-SoulStream/5488514a-11e8-482a-b0a0-20cb511ee110/scratchpad" P="$S/preflight" R=/f/Coding/SoulStream rm -rf "$P" && mkdir -p "$P" # the areas every patch so far has touched; enough for anchors, cheap to copy cp -r "$R/src" "$R/tests" "$R/crates" "$R/ANDROID.md" "$P/" 2>/dev/null # everything in src-tauri except the generated Android project and the build dir, # which are enormous and which no patch anchors against mkdir -p "$P/src-tauri" for e in "$R"/src-tauri/*; do case "$(basename "$e")" in gen|target) continue ;; esac cp -r "$e" "$P/src-tauri/" 2>/dev/null done ok=""; bad="" for n in "$@"; do if SS_ROOT="$P/" node "$S/patch-round$n.cjs" > "$P/round$n.log" 2>&1; then ok="$ok $n" echo " ok round $n" else bad="$bad $n" echo " FAIL round $n" grep -m1 "Error:" "$P/round$n.log" | cut -c1-200 fi done echo "--------" echo "applied cleanly in order:$ok" [ -n "$bad" ] && echo "needs a fix:$bad" exit 0