-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSMDB.bat
More file actions
34 lines (27 loc) · 862 Bytes
/
Copy pathSMDB.bat
File metadata and controls
34 lines (27 loc) · 862 Bytes
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
@echo off
setlocal EnableExtensions EnableDelayedExpansion
rem SMDB launcher for cmd.exe
rem Activates the .venv and runs the app as a module (python -m smdb)
set "ROOT=%~dp0"
set "VENV_DIR=%ROOT%.venv"
set "ACTIVATE_BAT=%VENV_DIR%\Scripts\activate.bat"
set "VENV_PY=%VENV_DIR%\Scripts\python.exe"
set "APP_MOD=smdb"
if not exist "%ACTIVATE_BAT%" (
echo [SMDB] ERROR: Virtual environment not found at "%VENV_DIR%".
echo [SMDB] Run setup.bat first to create it.
exit /b 1
)
echo [SMDB] Activating virtual environment
call "%ACTIVATE_BAT%"
rem Prefer venv python explicitly to avoid PATH issues
if exist "%VENV_PY%" (
set "PYEXE=%VENV_PY%"
) else (
rem Fallback to python on PATH (should be venv after activation)
set "PYEXE=python"
)
echo [SMDB] Running: %PYEXE% -m %APP_MOD% %*
"%PYEXE%" -m %APP_MOD% %*
set "CODE=%ERRORLEVEL%"
exit /b %CODE%