updates to launcer

This commit is contained in:
Mark Gregory
2026-10-23 09:43:32 +01:00
parent 135c731896
commit 3f636be91b
2 changed files with 0 additions and 72 deletions
-24
View File
@@ -1,24 +0,0 @@
#!/bin/zsh
set -euo pipefail
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"
LOG="$ROOT/build-logs/build-${CONFIGURATION}-$(date +%Y%m%d-%H%M%S).log"
echo "Building $APP_NAME ($CONFIGURATION)"
set -o pipefail
xcodebuild -project "$ROOT/OrionToolbar.xcodeproj" -scheme "$APP_NAME" -configuration "$CONFIGURATION" -derivedDataPath "$DERIVED" CODE_SIGNING_ALLOWED=NO build 2>&1 | tee "$LOG"
APP="$DERIVED/Build/Products/$CONFIGURATION/$APP_NAME.app"
[[ -d "$APP" ]] || { echo "Missing application: $APP" >&2; exit 1; }
plutil -lint "$APP/Contents/Info.plist"
EXE=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$APP/Contents/Info.plist")
[[ -x "$APP/Contents/MacOS/$EXE" ]] || { echo 'Application executable missing' >&2; exit 1; }
echo "Build complete: $APP"
echo "Log: $LOG"
if [[ "${1:-}" == '--launch' ]]; then
pkill -x "$APP_NAME" 2>/dev/null || true
open "$APP"
fi
-48
View File
@@ -1,48 +0,0 @@
#!/bin/zsh
set -euo pipefail
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"
LOG="$ROOT/build-logs/build-${CONFIGURATION}-$(date +%Y%m%d-%H%M%S).log"
echo "Building $APP_NAME ($CONFIGURATION)"
set -o pipefail
xcodebuild -project "$ROOT/OrionToolbar.xcodeproj" -scheme "$APP_NAME" -configuration "$CONFIGURATION" -derivedDataPath "$DERIVED" CODE_SIGNING_ALLOWED=NO build 2>&1 | tee "$LOG"
APP="$DERIVED/Build/Products/$CONFIGURATION/$APP_NAME.app"
[[ -d "$APP" ]] || { echo "Missing application: $APP" >&2; exit 1; }
plutil -lint "$APP/Contents/Info.plist"
EXE=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$APP/Contents/Info.plist")
[[ -x "$APP/Contents/MacOS/$EXE" ]] || { echo 'Application executable missing' >&2; exit 1; }
echo "Build complete: $APP"
echo "Log: $LOG"
if [[ "${1:-}" == '--launch' ]]; then
echo "Launching $APP_NAME..."
# Stop any previously running instance.
pkill -x "$APP_NAME" 2>/dev/null || true
sleep 1
# Launch the executable from this exact build.
EXECUTABLE="$APP/Contents/MacOS/$EXE"
[[ -x "$EXECUTABLE" ]] || {
echo "ERROR: Executable not found: $EXECUTABLE" >&2
exit 1
}
"$EXECUTABLE" > "$ROOT/build-logs/launch.log" 2>&1 &
APP_PID=$!
sleep 2
if ! kill -0 "$APP_PID" 2>/dev/null; then
echo "ERROR: Application exited immediately." >&2
cat "$ROOT/build-logs/launch.log"
exit 1
fi
echo "Launched $APP_NAME (PID $APP_PID)"
fi