-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.bat
More file actions
38 lines (30 loc) · 815 Bytes
/
run.bat
File metadata and controls
38 lines (30 loc) · 815 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
35
36
37
38
@echo off
setlocal
set "SCRIPT_DIR=%~dp0"
call "%SCRIPT_DIR%_cmd_utf8.bat" on
if not exist "%SCRIPT_DIR%config.yml" (
echo ❌ "%SCRIPT_DIR%config.yml" not found. Abort.
goto :fail
)
call python --version >nul 2>&1
if errorlevel 1 (
echo ❌ Python not found on the system.
goto :fail
)
if not exist "%SCRIPT_DIR%.venv\Scripts\python.exe" (
echo ❌ Virtual environment .venv not found. Run install.bat first.
goto :fail
)
if not exist "%SCRIPT_DIR%load_secrets.bat" (
echo ❌ "%SCRIPT_DIR%load_secrets.bat" not found. Abort.
goto :fail
)
call "%SCRIPT_DIR%load_secrets.bat"
"%SCRIPT_DIR%.venv\Scripts\python.exe" "%SCRIPT_DIR%gcm.py" %*
set "EXIT_CODE=%ERRORLEVEL%"
goto :end
:fail
set "EXIT_CODE=1"
:end
call "%SCRIPT_DIR%_cmd_utf8.bat" off
endlocal & exit /b %EXIT_CODE%