Former/debug.sh

30 lines
822 B
Bash
Executable File

#!/bin/bash
# Build Former for macOS — DEBUG mode (logs to ~/former/debug.log)
set -e
pkill -f "Former.app" || true
sleep 0.5
export SDKROOT=$(xcrun --show-sdk-path)
export CC=/usr/bin/clang
export CGO_ENABLED=1
WAILS=$(command -v wails || echo "$HOME/go/bin/wails")
# Generate app icon from Former.svg
echo "Generating app icon..."
go run ./cmd/genicon 2>/dev/null && echo "Icon generated." || echo "Icon generation skipped."
echo "Building Former (DEBUG)..."
"$WAILS" build -skipbindings -tags debug
echo ""
echo "Debug build complete. Logs will be written to ~/former/debug.log"
echo "Launching..."
open build/bin/Former.app
# Tail the log so you can see it live
sleep 1
echo ""
echo "=== Tailing ~/former/debug.log (Ctrl-C to stop) ==="
tail -f ~/former/debug.log 2>/dev/null || echo "Waiting for log file..."