forked from hackforla/shared-housing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-deb.sh
59 lines (43 loc) · 1.26 KB
/
build-deb.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
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# Helper function to call user attention to the instructions that follow
function printDoneMessage {
done_msg="BUILD COMPLETE"
msglen=${#done_msg}
cols=$(tput cols)
total_pad=`expr $cols - $msglen`
padlen=`expr $total_pad / 2`
x=0;
while [ $x -lt $cols ]; do echo -n '='; let x=$x+1; done;
x=0;
while [ $x -lt $padlen ]; do echo -n '='; let x=$x+1; done;
echo -n $done_msg;
x=0;
while [ $x -lt $padlen ]; do echo -n '='; let x=$x+1; done;
x=0;
while [ $x -lt $cols ]; do echo -n '='; let x=$x+1; done;
}
cd client
if npm install; then
if npm run build; then
echo "Client build complete.";
else
echo "Client build failed.";
exit 1;
fi
else
echo "Client failed to install dependencies.";
exit 1;
fi
cd ..
if [[ -d "server/api/templates" ]]; then
rm -rf server/api/templates
fi
if [[ -d "server/api/static" ]]; then
rm -rf server/api/static
fi
mkdir -p server/api/{templates,static}
mv client/dist/index.html server/api/templates
mv client/dist/* server/api/static
printDoneMessage
# echo "------ BUILD COMPLETE ------"
printf "\nUse the following command to push the build:\n\n scp -r server/api/* [email protected]:/home/sharedhousing/app\n"