Repository navigation
Expand file tree
/
Copy pathrun.bat
More file actions
56 lines (47 loc) · 1.49 KB
/
Copy pathrun.bat
File metadata and controls
56 lines (47 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@echo off
chcp 65001 >nul
setlocal
set PROJECT_ROOT=%~dp0
set VENV_PYTHON=%PROJECT_ROOT%.venv\Scripts\python.exe
cd /d "%PROJECT_ROOT%"
if /I "%~1"=="api" goto api
if /I "%~1"=="test" goto test
if /I "%~1"=="desktop" goto desktop
if /I "%~1"=="dev" goto dev
if "%~1"=="" goto desktop
echo Usage:
echo run.bat Open the main project desktop application
echo run.bat dev Start source API and Vite
echo run.bat desktop Start the desktop application
echo GUIRun.bat --dev Start from current frontend source
echo GUIRun.bat --release Build and start a release application
echo run.bat api Start only the HTTP API on port 8000
echo run.bat test Verify the Python startup environment
exit /b 1
:check_python
if not exist "%VENV_PYTHON%" (
echo [ERROR] Project environment not found.
echo Run: powershell -ExecutionPolicy Bypass -File .\setup.ps1
exit /b 1
)
"%VENV_PYTHON%" --version >nul 2>nul
if errorlevel 1 (
echo [ERROR] Project environment exists but its Python cannot start.
echo Repair it with setup.ps1 -CleanReinstall -PythonPath ^<python.exe^>.
exit /b 1
)
exit /b 0
:api
call :check_python || exit /b 1
"%VENV_PYTHON%" -m src.api.http --host 127.0.0.1 --port 8000
exit /b %errorlevel%
:test
call :check_python || exit /b 1
"%VENV_PYTHON%" scripts\verify_env.py
exit /b %errorlevel%
:desktop
call "%PROJECT_ROOT%GUIRun.bat" --desktop
exit /b %errorlevel%
:dev
call "%PROJECT_ROOT%GUIRun.bat" --dev
exit /b %errorlevel%