Files
my-pal-mcp-server/run_gemini.bat
Fahad ae64ede51f feat: auto-run setup when virtual environment is missing
- Update run_gemini.sh to automatically run setup.sh if venv doesn't exist
- Update run_gemini.bat to automatically run setup.bat if venv doesn't exist
- Remove fallback to system Python - always use venv for consistency
- Provide clear error messages if setup fails

This ensures users don't see "ModuleNotFoundError" - instead the server
will automatically set up dependencies on first run.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 20:52:47 +04:00

34 lines
959 B
Batchfile

@echo off
REM Windows batch script to run Gemini MCP server
REM Get the directory where this script is located
set SCRIPT_DIR=%~dp0
REM Change to script directory to ensure proper working directory
cd /d "%SCRIPT_DIR%"
REM Check if virtual environment exists
if not exist "%SCRIPT_DIR%venv\" (
echo Virtual environment not found. Running setup... >&2
REM Check if setup.bat exists
if exist "%SCRIPT_DIR%setup.bat" (
REM Run setup script
call "%SCRIPT_DIR%setup.bat" >&2
REM Check if setup was successful
if errorlevel 1 (
echo Setup failed. Please run setup.bat manually to see the error. >&2
exit /b 1
)
) else (
echo Error: setup.bat not found. Please ensure you have the complete repository. >&2
exit /b 1
)
)
REM Activate virtual environment
call "%SCRIPT_DIR%venv\Scripts\activate.bat"
REM Run the server
python "%SCRIPT_DIR%server.py"