-
Notifications
You must be signed in to change notification settings - Fork 629
Expand file tree
/
Copy pathstart-dev.sh
More file actions
executable file
·47 lines (41 loc) · 1.39 KB
/
start-dev.sh
File metadata and controls
executable file
·47 lines (41 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Function to check if the server is running
check_server() {
nc -z localhost 4242
}
# # Check if the user wants VSCode
# if [ "$1" = "--vscode" ]; then
# # AppleScript to open VSCode, create terminals, and run commands
# osascript <<EOF
# tell application "Visual Studio Code"
# activate
# delay 1
# tell application "System Events"
# keystroke "j" using {command down, shift down}
# delay 1
# keystroke "t" using {command down, shift down}
# delay 1
# keystroke "cd $PWD && bun run dev:start-server"
# delay 1
# key code 36
# delay 1
# keystroke "t" using {command down, shift down}
# delay 1
# keystroke "cd $PWD && bun run dev:start-client"
# delay 1
# key code 36
# end tell
# end tell
# EOF
# echo "VSCode terminals opened and commands executed."
# exit 0
# fi
osascript -e 'tell app "Terminal" to do script "cd '"$PWD"' && bun run start-server"'
echo "Waiting for server to start..."
while ! nc -z localhost 4242; do
sleep 5
done
# Start the client
osascript -e 'tell app "Terminal" to do script "cd '"$PWD"' && bun run start-client"'
echo "Server and client started in separate terminal windows."
# echo "If you prefer to use VSCode terminals, run this script with the --vscode flag."