优化半自动更新功能,修复已知问题并增强稳定性
This commit is contained in:
29
build-frontend.bat
Normal file
29
build-frontend.bat
Normal file
@@ -0,0 +1,29 @@
|
||||
@echo off
|
||||
setlocal
|
||||
set REPO=%~dp0
|
||||
set WEBDIST=%REPO%web-dist
|
||||
|
||||
echo [1/4] build frontend (pnpm build) ...
|
||||
cd /d %REPO%jeecgboot-vue3
|
||||
call pnpm run build
|
||||
if errorlevel 1 ( echo [ERROR] frontend build failed & pause & exit /b 1 )
|
||||
if not exist "%REPO%jeecgboot-vue3\dist\index.html" ( echo [ERROR] dist/index.html not found & pause & exit /b 1 )
|
||||
|
||||
echo [2/4] refresh web-dist folder ...
|
||||
if exist "%WEBDIST%" rmdir /S /Q "%WEBDIST%"
|
||||
mkdir "%WEBDIST%"
|
||||
xcopy "%REPO%jeecgboot-vue3\dist\*" "%WEBDIST%\" /E /Y /I >nul
|
||||
|
||||
echo [3/4] git add and commit web-dist ...
|
||||
cd /d %REPO%
|
||||
git add web-dist
|
||||
git commit -m "frontend build dist update"
|
||||
|
||||
echo [4/4] git push ...
|
||||
git push
|
||||
if errorlevel 1 ( echo [ERROR] git push failed & pause & exit /b 1 )
|
||||
|
||||
echo.
|
||||
echo ===== FRONTEND BUILT AND PUSHED. Now run deploy-frontend.bat on the server. =====
|
||||
endlocal
|
||||
pause
|
||||
Reference in New Issue
Block a user