This commit is contained in:
Mark Gregory
2026-10-23 09:40:39 +01:00
parent 515a1464a3
commit 135c731896
+16 -20
View File
@@ -1,12 +1,21 @@
#!/bin/zsh
set -euo pipefail
echo "=== CLION LAUNCH DIAGNOSTICS ==="
echo "Script: $0"
echo "Argument count: $#"
echo "Arguments: $*"
echo "Working directory: $PWD"
echo "Parent process: $PPID"
echo "================================"
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
APP_NAME=OrionToolbar
DERIVED="$ROOT/.build"
CONFIGURATION="${CONFIGURATION:-Debug}"
[[ "$CONFIGURATION" == Debug || "$CONFIGURATION" == Release ]] || { echo 'CONFIGURATION must be Debug or Release' >&2; exit 2; }
mkdir -p "$ROOT/.build/build-logs"
mkdir -p "$ROOT/build-logs"
LOG="$ROOT/build-logs/build-${CONFIGURATION}-$(date +%Y%m%d-%H%M%S).log"
echo "Building $APP_NAME ($CONFIGURATION)"
set -o pipefail
@@ -19,35 +28,22 @@ EXE=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$APP/Contents/Info
echo "Build complete: $APP"
echo "Log: $LOG"
if [[ "${1:-}" == "--launch" ]]; then
echo
echo "=== LAUNCHING ORIONTOOLBAR ==="
pkill -x "$APP_NAME" 2>/dev/null || true
sleep 1
sleep 2
APP_EXEC="$APP/Contents/MacOS/$EXE"
if [[ ! -x "$APP_EXEC" ]]; then
echo "ERROR: Application executable missing: $APP_EXEC"
exit 1
fi
echo "Application: $APP"
echo "Executable: $APP_EXEC"
# Launch the exact built application as a separate macOS process.
/usr/bin/open -n "$APP" --args
# Launch independently through macOS Launch Services.
/usr/bin/open -n -a "$APP"
sleep 3
if /usr/bin/pgrep -x "$APP_NAME" >/dev/null; then
echo "SUCCESS: OrionToolbar is running."
/usr/bin/pgrep -fl "$APP_NAME"
echo "SUCCESS: OrionToolbar launched."
else
echo "ERROR: OrionToolbar did not remain running."
echo "Try launching the executable directly:"
echo "$APP_EXEC"
echo "ERROR: OrionToolbar is not running."
exit 1
fi
fi