Datasets:
File size: 1,297 Bytes
3fbbdd9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #!/usr/bin/env bash
#
# Launch script for massCode.
# Locates the built .app bundle relative to this script and runs it, passing
# through any command-line arguments.
#
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
APP_NAME="massCode.app"
# Candidate locations, in priority order.
CANDIDATES=()
[ -n "${APP_OUTPUT_DIR:-}" ] && CANDIDATES+=("$APP_OUTPUT_DIR/$APP_NAME")
CANDIDATES+=(
"$SCRIPT_DIR/$APP_NAME"
"$SCRIPT_DIR/dist/mac/$APP_NAME"
"$SCRIPT_DIR/dist/mac-arm64/$APP_NAME"
"$SCRIPT_DIR/dist/mac-universal/$APP_NAME"
)
APP=""
for c in "${CANDIDATES[@]}"; do
if [ -d "$c" ]; then APP="$c"; break; fi
done
# Fallback: search the dist tree.
if [ -z "$APP" ] && [ -d "$SCRIPT_DIR/dist" ]; then
APP="$(find "$SCRIPT_DIR/dist" -maxdepth 2 -name "$APP_NAME" -type d -print -quit 2>/dev/null || true)"
fi
if [ -z "$APP" ] || [ ! -d "$APP" ]; then
echo "!! $APP_NAME not found. Run build.sh first." >&2
exit 1
fi
BIN="$APP/Contents/MacOS/massCode"
if [ ! -x "$BIN" ]; then
echo "!! Executable not found at $BIN" >&2
exit 1
fi
echo ">> Launching: $APP"
# Run the Electron binary directly (foreground) so logs are visible and args
# are passed through. The bundle is self-contained; no extra runtime env needed.
exec "$BIN" --force-renderer-accessibility "$@"
|