feat: add one-click startup scripts for project management
- Add start.sh/start.bat for one-click startup (backend + frontend) - Add stop.sh/stop.bat for stopping all services - Add restart.sh for restarting services - Add status.sh for checking service status - Add Makefile with convenient management commands - Add comprehensive documentation (ONE_CLICK_START.md) - Update README with one-click startup instructions Features: - Automatic environment checking (venv, node_modules) - Process management with PID tracking - Unified log management (logs/*.log) - Health checking after startup - Support for Linux, macOS, and Windows - No more need for multiple terminal windows Usage: ./start.sh # Start all services ./stop.sh # Stop all services ./status.sh # Check service status ./restart.sh # Restart services make start # Alternative using Makefile Benefits: - One command instead of multiple terminals - Automatic environment validation - Centralized logging - Process lifecycle management - Developer-friendly output messages
This commit is contained in:
39
stop.bat
Normal file
39
stop.bat
Normal file
@@ -0,0 +1,39 @@
|
||||
@echo off
|
||||
REM ERP AI Assistant - Windows 停止脚本
|
||||
|
||||
echo ========================================
|
||||
echo ERP AI Assistant - 停止中...
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
echo 查找并停止后端进程...
|
||||
for /f "tokens=2" %%i in ('tasklist ^| findstr /i "python.*app.main"') do (
|
||||
echo 停止进程: %%i
|
||||
taskkill /PID %%i /F > nul 2>&1
|
||||
)
|
||||
|
||||
echo 查找并停止前端进程...
|
||||
for /f "tokens=2" %%i in ('tasklist ^| findstr /i "node.*vite"') do (
|
||||
echo 停止进程: %%i
|
||||
taskkill /PID %%i /F > nul 2>&1
|
||||
)
|
||||
|
||||
REM 也尝试通过端口查找进程
|
||||
echo 检查端口占用...
|
||||
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":8000" ^| findstr "LISTENING"') do (
|
||||
echo 停止后端进程: %%a
|
||||
taskkill /PID %%a /F > nul 2>&1
|
||||
)
|
||||
|
||||
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":5173" ^| findstr "LISTENING"') do (
|
||||
echo 停止前端进程: %%a
|
||||
taskkill /PID %%a /F > nul 2>&1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
echo 停止完成
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
pause
|
||||
Reference in New Issue
Block a user