chore: 编译产物不再入库,启动脚本改用 server.exe

- server.exe 早已写在 .gitignore 第 9 行,却仍被追踪,规则一直没生效(.gitignore
  只管未被追踪的文件)。git rm --cached 移出索引,本地文件保留
- 启动项目.bat 改为启动前先 go build 重建再运行 server.exe,编译失败就停住不启动:
  原来用 go run 正是为了不跑到过期的 exe,换成 exe 后得靠这一步补上
This commit is contained in:
文睿 张 2026-10-10 17:32:30 +08:00
parent f634e7cf07
commit ec7742a39c
2 changed files with 12 additions and 2 deletions

Binary file not shown.

View File

@ -3,9 +3,19 @@ title Warehouse Management System Launcher
cd /d "%~dp0"
echo Building backend...
rem Rebuild on every launch so the executable can never be a stale one.
go build -o server.exe ./cmd/server
if errorlevel 1 (
echo.
echo Backend build failed. Fix the errors above and run this launcher again.
pause
exit /b 1
)
echo Starting backend (8082)...
rem Run the current source so local testing never uses an outdated server.exe.
start "Warehouse MMS - Backend" /D "%~dp0" cmd /k "go run ./cmd/server"
rem Work dir must stay at the project root: frontend/dist and uploads are relative paths.
start "Warehouse MMS - Backend" /D "%~dp0" cmd /k "server.exe"
echo Starting frontend (8083)...
start "Warehouse MMS - Frontend" /D "%~dp0frontend" cmd /k "npm run dev"