forked from godsakani/reportcard-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
39 lines (34 loc) · 1014 Bytes
/
run
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
#!/usr/bin/env bash
# check if rc.jar exists
if [ ! -f "dist-app/rc.jar" ]; then
echo "rc.jar not found"
echo "Downloading rc.jar"
wget https://github.com/transkript/reportcard-backend/releases/download/v0.0.3/rc-application-0.0.3-SNAPSHOT.jar
mkdir dist-app
mv rc-application-0.0.3-SNAPSHOT.jar dist-app/rc.jar
else
echo "rc.jar found"
echo "Continuing..."
fi
# run the ngbuild commands disconnected from the terminal
# check if port is in use
if [ "$(lsof -Pi :8090 -sTCP:LISTEN -t)" ]; then
echo "Port 8090 is in use"
echo "Please close the application and try again"
# ask to kill the process
read -p "Kill the process holding the port? (y/n): " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Killing the process"
kill $(lsof -t -i:8090)
else
echo "Exiting"
exit 1
fi
else
echo "Port 8080 is available"
echo "Continuing..."
fi
java -jar dist-app/rc.jar&
ng serve