Files
2026-09-30 22:31:58 +02:00

29 lines
1.2 KiB
Bash
Executable File

#!/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'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key><string>BlocksSpike</string>
<key>CFBundleIdentifier</key><string>de.babylondreams.museion.spike-c</string>
<key>CFBundleName</key><string>Spike C — Blocks</string>
<key>CFBundlePackageType</key><string>APPL</string>
<key>LSMinimumSystemVersion</key><string>26.0</string>
<key>NSHighResolutionCapable</key><true/>
<key>NSSupportsAutomaticWindowRestoration</key><false/>
</dict>
</plist>
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"