-
Notifications
You must be signed in to change notification settings - Fork 0
/
Start.bat
55 lines (46 loc) · 1.1 KB
/
Start.bat
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
@echo off
title ETS2LA-Lite Console
echo.
echo ETS2LA-Lite
echo -----------
echo.
cd %~dp0
if not exist venv (
echo Creating venv...
python -m venv venv
call venv/Scripts/activate
python.exe -m pip install --upgrade pip >nul 2>&1
) else (
call venv/Scripts/activate
)
if not exist config/requirements.txt (
echo requirements.txt not found.
goto end
)
echo Checking required packages...
set MISSING_PACKAGES=0
for /f "tokens=*" %%a in ('pip list --format=freeze 2^>nul') do (
for /f "tokens=1 delims==" %%b in ("%%a") do (
set "INSTALLED_PACKAGES[%%b]=1"
)
)
for /f "tokens=*" %%a in (config/requirements.txt) do (
for /f "tokens=1 delims==" %%b in ("%%a") do (
if not defined INSTALLED_PACKAGES[%%b] (
echo ^> Installing %%b...
set MISSING_PACKAGES=1
)
)
)
if %MISSING_PACKAGES% equ 1 (
echo Installing all required packages...
pip install -r config/requirements.txt -q --force-reinstall >nul 2>&1
)
echo All required packages installed.
echo.
echo Running App
echo -----------
echo.
python app/main.py
:end
pause