#!/usr/bin/env bash # Build a minimal KeiSei.app bundle that opens Terminal with `kei`. # # Output: $OUT_DIR/KeiSei.app (default OUT_DIR=$HOME/Applications) # Usage: # ./tools/mac-app/build.sh # → ~/Applications/KeiSei.app # OUT_DIR=/tmp ./tools/mac-app/build.sh # → /tmp/KeiSei.app # # Requires: macOS (uses osascript). On Linux/Windows this is a no-op. set -euo pipefail OUT_DIR="${OUT_DIR:-$HOME/Applications}" APP="$OUT_DIR/KeiSei.app" if [ "$(uname -s)" != "Darwin" ]; then echo "skip: macOS only (current OS: $(uname -s))" >&2 exit 0 fi mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" cat > "$APP/Contents/MacOS/KeiSei" <<'LAUNCHER' #!/bin/bash # Open Terminal with `kei` (the KeiSeiKit launcher). # Falls back to `keisei` (Rust binary) help if `kei` not on PATH. osascript < "$APP/Contents/Info.plist" < CFBundleExecutable KeiSei CFBundleIdentifier com.keisei.launcher CFBundleName KeiSei CFBundleDisplayName KeiSei CFBundlePackageType APPL CFBundleVersion 0.16 CFBundleShortVersionString 0.16 NSHighResolutionCapable LSUIElement PLIST echo "✓ Built: $APP" echo " Drag to /Applications or run from Spotlight: 'KeiSei'"