forked from MCSManager/MCSManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·57 lines (42 loc) · 1.71 KB
/
build.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/sh
set -e
BASE_PATH=$(pwd)
npm run preview-build
rm -rf production-code
rm -rf ./daemon/dist ./daemon/production
rm -rf ./panel/dist ./panel/production
echo "Build daemon..."
cd "${BASE_PATH}/daemon"
npm run build
echo "Build panel..."
cd "${BASE_PATH}/panel"
npm run build
echo "Build frontend..."
cd "${BASE_PATH}/frontend"
npm run build
echo "Collecting files..."
cd "${BASE_PATH}"
mkdir production-code
mkdir production-code/daemon
mkdir production-code/web
mkdir production-code/web/public
mv "${BASE_PATH}/daemon/production/app.js" "${BASE_PATH}/production-code/daemon"
mv "${BASE_PATH}/daemon/production/app.js.map" "${BASE_PATH}/production-code/daemon"
cp -f "${BASE_PATH}/daemon/package.json" "${BASE_PATH}/production-code/daemon/package.json"
cp -f "${BASE_PATH}/daemon/package-lock.json" "${BASE_PATH}/production-code/daemon/package-lock.json"
mv "${BASE_PATH}/panel/production/app.js" "${BASE_PATH}/production-code/web"
mv "${BASE_PATH}/panel/production/app.js.map" "${BASE_PATH}/production-code/web"
cp -f "${BASE_PATH}/panel/package.json" "${BASE_PATH}/production-code/web/package.json"
cp -f "${BASE_PATH}/panel/package-lock.json" "${BASE_PATH}/production-code/web/package-lock.json"
mv "${BASE_PATH}"/frontend/dist/* "${BASE_PATH}/production-code/web/public"
rm -rf "${BASE_PATH}/daemon/dist" "${BASE_PATH}/daemon/production"
rm -rf "${BASE_PATH}/panel/dist" "${BASE_PATH}/panel/production"
rm -rf "${BASE_PATH}/frontend/dist"
cd "${BASE_PATH}/production-code/daemon"
npm install --production --no-fund --no-audit
cd "${BASE_PATH}/production-code/web"
npm install --production --no-fund --no-audit
echo "------------"
echo "Compilation completed!"
echo "Output Directory: ./production-code/"
echo "------------"