approve闭环 where go >nul 2>&1 if errorlevel 1 ( echo [build] 未找到 go exit /b 1 ) where npm >nul 2>&1 if errorlevel 1 ( echo [build] 未找到 npm exit /b 1 ) if not exist dist ( mkdir dist if errorlevel 1 ( echo [build] 无法创建 dist exit /b 1 ) ) else ( echo [build] 清空 dist del /f /q /a dist\* >nul 2>&1 for /d %%D in ("dist\*") do rmdir /s /q "%%D" dir /b dist 2>nul | findstr . >nul if not errorlevel 1 ( echo [build] dist 未能清空,请关闭正在占用该目录的程序后重试 exit /b 1 ) ) echo [build] linux dist\sheying.app set CGO_ENABLED=0 set GOOS=linux set GOARCH=amd64 go build -o dist\sheying.app . if errorlevel 1 exit /b 1 echo [build] windows dist\sheying.exe set GOOS=windows set GOARCH=amd64 go build -o dist\sheying.exe . if errorlevel 1 exit /b 1 echo [build] admin dist\admin\ pushd apps\admin call npm run build
approve闭环 where go >nul 2>&1 if errorlevel 1 ( echo [build] 未找到 go exit /b 1 ) where npm >nul 2>&1 if errorlevel 1 ( echo [build] 未找到 npm exit /b 1 ) if not exist dist ( mkdir dist if errorlevel 1 ( echo [build] 无法创建 dist exit /b 1 ) ) else ( echo [build] 清空 dist del /f /q /a dist\* >nul 2>&1 for /d %%D in ("dist\*") do rmdir /s /q "%%D" dir /b dist 2>nul | findstr . >nul if not errorlevel 1 ( echo [build] dist 未能清空,请关闭正在占用该目录的程序后重试 exit /b 1 ) ) echo [build] linux dist\sheying.app set CGO_ENABLED=0 set GOOS=linux set GOARCH=amd64 go build -o dist\sheying.app . if errorlevel 1 exit /b 1 echo [build] windows dist\sheying.exe set GOOS=windows set GOARCH=amd64 go build -o dist\sheying.exe . if errorlevel 1 exit /b 1 echo [build] admin dist\admin\ pushd apps\admin call npm run build
大摄天下