#!/bin/zsh # ponytail: wrap the SPM binary in a minimal .app — SwiftUI needs a bundle to make windows. set -e ROOT="$PWD" cd "$(dirname "$0")" swift build 2>&1 | tail -1 APP=.build/BlocksSpike.app rm -rf "$APP" && mkdir -p "$APP/Contents/MacOS" cp .build/debug/BlocksSpike "$APP/Contents/MacOS/" cat > "$APP/Contents/Info.plist" <<'PLIST' CFBundleExecutableBlocksSpike CFBundleIdentifierde.babylondreams.museion.spike-c CFBundleNameSpike C — Blocks CFBundlePackageTypeAPPL LSMinimumSystemVersion26.0 NSHighResolutionCapable NSSupportsAutomaticWindowRestoration PLIST # ponytail: always hand the binary an ABSOLUTE corpus path — its cwd here is spike/blocks ARG="${1:-$ROOT/spike/prose/the-expected-value-of-showing.md}" case "$ARG" in /*) ;; *) ARG="$ROOT/$ARG" ;; esac exec "$APP/Contents/MacOS/BlocksSpike" "$ARG"