#!/usr/bin/env bash # Setup script for the F∆I Law-Heatmap Flutter client. # # Idempotent — safe to re-run. Performs the steps that a fresh # checkout needs before `flutter run -d macos` works: # # 1. Download SIL-OFL fonts (Space Grotesk, Inter, JetBrains Mono) # from the upstream google/fonts repo into assets/fonts/. # 2. Clear macOS extended attributes (curl + iCloud-Drive tag # `com.apple.provenance`) that break Apple's CodeSign step. # 3. Resolve packages. set -euo pipefail cd "$(dirname "$0")" mkdir -p assets/fonts fetch() { local url=$1 out=$2 if [ -s "assets/fonts/$out" ]; then echo " font already present: $out" return fi echo " fetching: $out" curl -fsSLo "assets/fonts/$out" "$url" } echo "[1/3] Fonts (SIL OFL, redistribution allowed)" fetch "https://github.com/google/fonts/raw/main/ofl/spacegrotesk/SpaceGrotesk%5Bwght%5D.ttf" "SpaceGrotesk[wght].ttf" fetch "https://github.com/google/fonts/raw/main/ofl/inter/Inter%5Bopsz%2Cwght%5D.ttf" "Inter[opsz,wght].ttf" fetch "https://github.com/google/fonts/raw/main/ofl/jetbrainsmono/JetBrainsMono%5Bwght%5D.ttf" "JetBrainsMono[wght].ttf" echo "[2/3] Strip extended attributes" xattr -cr assets/ 2>/dev/null || true xattr -cr macos/ 2>/dev/null || true xattr -cr . 2>/dev/null || true echo "[3/3] Resolve Flutter packages" flutter pub get echo "done — try: flutter run -d macos"