#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
mkdir -p logs
: "${GOTRACEBACK:=crash}"
BIN="./XXTLanControl.app/Contents/MacOS/XXTLanControl-backend"
DIST="./XXTLanControl.app/Contents/Resources/dist"
LOG="logs/backend-$(date +%F).log"
echo "Version: v202606281559 (commit fea59c7)"
echo "Starting $BIN, logging to $LOG"
xattr -r -d com.apple.quarantine "./XXTLanControl.app" 2>/dev/null || true
"$BIN" --dist "$DIST" 2>&1 | tee -a "$LOG"
