This repository has been archived by the owner on Feb 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
compile.sh
executable file
·52 lines (41 loc) · 1.77 KB
/
compile.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
#!/bin/bash
RED='\033[1;31m'
GREEN='\033[1;32m'
YELLOW='\033[1;33m'
BLUE='\033[1;34m'
PINK='\033[1;35m'
NC='\033[0m'
read -r -d '' Banner <<EOF
${BLUE}######## ######## ${GREEN} ###### ### ${RED}## ######## ${PINK} ####### ## ##
${BLUE}## ## ## ${GREEN}## ## ## ## ${RED}## ## ## ${PINK}## ## ## ##
${BLUE}## ## ## ${GREEN}## ## ## ${RED}## ## ## ${PINK}## ## ## ##
${BLUE}######## ###### ${GREEN}## ## ## ${RED}## ######## ${PINK}## ## ###
${BLUE}## ## ## ${GREEN}## ######### ${RED}## ## ## ${PINK}## ## ## ##
${BLUE}## ## ## ${GREEN}## ## ## ## ${RED}## ## ## ${PINK}## ## ## ##
${BLUE}## ## ######## ${GREEN} ###### ## ## ${RED}######## ######## ${PINK} ####### ## ##${NC}
EOF
echo -e "$Banner"
echo
echo -e "${YELLOW}Compiling ${BLUE}re${GREEN}ca${RED}lb${PINK}ox${YELLOW} - web manager${NC}"
echo
echo -e "${BLUE}Installing building dependencies...${NC}"
npm run -s installboth || exit $?
echo -e "${BLUE}Building sources ${RED}(be patient!)${BLUE}...${NC}"
npm run -s buildboth || exit $?
echo -e "${BLUE}Copying files into release directory...${NC}"
rm -rf release
mkdir -p release/config
mkdir -p release/client
mkdir -p release/locales
cp -R client/build release/client
find . -type f -name '*.map' -exec rm {} + # removing useless "map files"
cp config/default.js release/config
cp config/production.js release/config
cp -R dist release
cp locales/*.json release/locales
cp package.json release
echo -e "${BLUE}Installing production dependencies...${NC}"
cd release
npm install --production || exit $?
echo
echo -e "${YELLOW}Compilation done! All you need is inside the release folder!${NC}"