diff --git a/scripts/restart-mac.sh b/scripts/restart-mac.sh index e4ac99371..fb6d5e867 100755 --- a/scripts/restart-mac.sh +++ b/scripts/restart-mac.sh @@ -62,43 +62,11 @@ run_step "swift build" bash -lc "cd '${ROOT_DIR}/apps/macos' && swift build -q - # 3) Package + relaunch the app (script also stops any stragglers). run_step "package app" "${ROOT_DIR}/scripts/package-mac-app.sh" -# 4) Install launch agent with Mach service and bootstrap it (no KeepAlive). -cat > "${LAUNCH_AGENT}" < - - - - Label - com.steipete.clawdis - ProgramArguments - - ${APP_BUNDLE}/Contents/MacOS/Clawdis - - WorkingDirectory - ${ROOT_DIR} - RunAtLoad - - KeepAlive - - MachServices - - com.steipete.clawdis.xpc - - - StandardOutPath - /tmp/clawdis.log - StandardErrorPath - /tmp/clawdis.log - - -PLIST - -stop_launch_agent -run_step "bootstrap launch agent" launchctl bootstrap gui/"$UID" "${LAUNCH_AGENT}" -run_step "kickstart" launchctl kickstart -k gui/"$UID"/com.steipete.clawdis +# 4) Launch the packaged app in the foreground so the menu bar extra appears. +run_step "launch app" open "${APP_BUNDLE}" # 5) Verify the packaged app is alive. -sleep 1 +sleep 1.5 if pgrep -f "${APP_PROCESS_PATTERN}" >/dev/null 2>&1; then log "OK: Clawdis is running." else