MCSManager/build.sh

53 lines
1.2 KiB
Bash
Raw Normal View History

2023-08-21 12:41:50 +08:00
#!/bin/sh
2024-04-18 11:28:09 +08:00
set -e
2023-11-15 21:22:06 +08:00
npm run preview-build
2023-08-21 12:41:50 +08:00
2023-08-20 22:57:10 +08:00
rm -rf production-code
rm -rf ./daemon/dist ./daemon/production
rm -rf ./panel/dist ./panel/production
echo "Build daemon..."
cd daemon
npm run build
echo "Build panel..."
cd ..
cd panel
npm run build
2023-08-20 23:06:38 +08:00
echo "Build frontend..."
cd ..
cd frontend
npm run build
2023-08-20 22:57:10 +08:00
echo "Collecting files..."
cd ..
mkdir production-code
mkdir production-code/daemon
mkdir production-code/web
mkdir production-code/web/public
2023-08-20 23:06:38 +08:00
mv ./daemon/production/app.js ./production-code/daemon
2024-05-09 16:05:31 +08:00
mv ./daemon/production/app.js.map ./production-code/daemon
2023-08-20 22:57:10 +08:00
cp ./daemon/package.json ./production-code/daemon/package.json
cp ./daemon/package-lock.json ./production-code/daemon/package-lock.json
2023-08-20 23:06:38 +08:00
mv ./panel/production/app.js ./production-code/web
2024-05-09 16:05:31 +08:00
mv ./panel/production/app.js.map ./production-code/web
2023-08-20 22:57:10 +08:00
cp ./panel/package.json ./production-code/web/package.json
cp ./panel/package-lock.json ./production-code/web/package-lock.json
2023-08-20 23:06:38 +08:00
mv ./frontend/dist/* ./production-code/web/public
2023-08-20 22:57:10 +08:00
rm -rf ./daemon/dist ./daemon/production
rm -rf ./panel/dist ./panel/production
2023-08-20 23:06:38 +08:00
rm -rf ./frontend/dist
2023-08-20 22:57:10 +08:00
echo "------------"
2024-04-18 11:28:09 +08:00
echo "Compilation completed!"
echo "Output Directory: ./production-code/"
echo "------------"