32 lines · 845 B · Shell
RawDownload
#!/bin/bashset -euo pipefail # Simple script to launch CodexBar (kills existing instance first)# Usage: ./Scripts/launch.sh SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"APP_PATH="$PROJECT_ROOT/CodexBar.app" echo "==> Killing existing CodexBar instances"pkill -x CodexBar || pkill -f CodexBar.app || truesleep 0.5 if [[ ! -d "$APP_PATH" ]]; then    echo "ERROR: CodexBar.app not found at $APP_PATH"    echo "Run ./Scripts/package_app.sh first to build the app"    exit 1fi echo "==> Launching CodexBar from $APP_PATH"open -n "$APP_PATH" # Wait a moment and check if it's runningsleep 1if pgrep -x CodexBar > /dev/null; then    echo "OK: CodexBar is running."else    echo "ERROR: App exited immediately. Check crash logs in Console.app (User Reports)."    exit 1fi