MCSManager/build.sh

46 lines
1019 B
Bash
Raw Normal View History

2023-08-21 12:41:50 +08:00
#!/bin/sh
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
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
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 "------------"
echo "Done!"
echo "------------"