File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/zsh
2+
3+ set -euo pipefail
4+
5+ BACKEND_URL=" http://127.0.0.1:8010/health"
6+ FRONTEND_URL=" http://127.0.0.1:8080/login"
7+ FRONTEND_ROOT=" /Users/lucaomul/InboxAnchor/frontend"
8+ FRONTEND_LOG=" /private/tmp/inboxanchor-frontend.log"
9+ BACKEND_LABEL=" gui/$( id -u) /com.luca.inboxanchor.backend"
10+
11+ launchctl kickstart -k " $BACKEND_LABEL " > /dev/null 2>&1 || true
12+
13+ if ! curl -fsS " $FRONTEND_URL " > /dev/null 2>&1 ; then
14+ (
15+ cd " $FRONTEND_ROOT "
16+ nohup npm run dev > " $FRONTEND_LOG " 2>&1 &
17+ )
18+ fi
19+
20+ for _ in {1..30}; do
21+ if curl -fsS " $BACKEND_URL " > /dev/null 2>&1 && curl -fsS " $FRONTEND_URL " > /dev/null 2>&1 ; then
22+ break
23+ fi
24+ sleep 1
25+ done
26+
27+ osascript << 'APPLESCRIPT '
28+ tell application " Safari"
29+ activate
30+ open location " http://127.0.0.1:8080/login"
31+ end tell
32+ APPLESCRIPT
You can’t perform that action at this time.
0 commit comments