-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun-locally.sh
executable file
·47 lines (34 loc) · 933 Bytes
/
run-locally.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
39
40
41
42
43
44
45
46
47
#!/bin/bash
# BUILD FRONT AND COPY IT TO BACKEND/SRC/PUBLIC
# Navigate to the frontend directory
cd ./truco-front
# install packages
npm install
# Run the npm build script
npm run build
# Check if the build was successful
if [ $? -eq 0 ]; then
echo "Frontend build successful. Copying files to backend."
# Navigate back to the original directory
cd ..
rm -rf ./truco-back/src/public/
# Copy the contents of frontend/dist to backend/src/public
cp -r ./truco-front/dist/ ./truco-back/src/public/
echo "Copy completed."
else
echo "Frontend build failed. Aborting copy to backend."
fi
# COMPILE BACKEND AND RUN IT
# Navigate to the backend directory
cd ./truco-back
# install packages
npm install
# Run the npm build script
npm run build
# Check if the build was successful
if [ $? -eq 0 ]; then
echo "Backend build successful."
npm run start
else
echo "Backend build failed."
fi