@echo off cd /d "%~dp0" echo [1/4] Stopping service on port 5215... for /f "tokens=5" %%p in ('netstat -ano ^| findstr :5215 ^| findstr LISTENING') do ( taskkill /PID %%p /F >nul 2>&1 ) echo [2/4] Pulling latest changes... git pull origin main if errorlevel 1 ( echo ERROR: git pull failed. Resolve conflicts manually. exit /b 1 ) echo [3/4] Updating dependencies... if not exist .venv ( py -3.12 -m venv .venv ) .venv\Scripts\python -m pip install --upgrade pip >nul .venv\Scripts\pip install -e ".[dev]" if errorlevel 1 ( echo ERROR: dependency install failed. exit /b 1 ) echo [4/4] Starting service... call run.bat