-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·38 lines (32 loc) · 908 Bytes
/
start.sh
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
#!/bin/bash
# Setup
./setup.sh
sleep 5
# Function to find and kill processes listening on specific ports
kill_process_on_port() {
local port=$1
local pid=$(lsof -ti:$port) # Get PID of process listening on the port
if [ -n "$pid" ]; then
echo "Killing process on port $port (PID: $pid)..."
kill -9 $pid # Kill the process
else
echo "No process found on port $port."
fi
}
# Run 'npm run dev' command in other folders
cd user-service
kill_process_on_port 8000
npm start &
cd ../bottle-service
kill_process_on_port 8001
npm start &
cd ../chat-service
kill_process_on_port 8002
npm start &
# Run 'npx react-native start' and 'npx react-native run-ios' commands in 'frontend' folder
cd ../frontend/
kill_process_on_port 8081
npx react-native start &
sleep 5
npx react-native run-ios --simulator='iPhone 15'
npx react-native run-ios --simulator='iPhone 15 Plus'