-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.bat
38 lines (30 loc) · 823 Bytes
/
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
@echo off
set "DIR=%~dp0"
set "VENV_DIR=%DIR%venv"
set "PYTHON_VENV=%VENV_DIR%\Scripts\python.exe"
if not exist ffmpeg.exe (
echo FFMPEG not found, installing...
call .\install_ffmpeg.bat
)
if exist "%VENV_DIR%" (
echo Venv found.
) else (
echo Venv not found, creating one...
python -m venv "%VENV_DIR%"
if exist "%PYTHON_VENV%" (
echo Venv successfully created.
) else (
echo Error occured while creating venv. Exiting...
exit /b 1
)
echo Installing dependencies from requirements.txt...
"%PYTHON_VENV%" -m pip install -r "%DIR%requirements.txt"
if %errorlevel% neq 0 (
echo Error occured while installing dependencies. Exiting...
exit /b 1
)
)
echo Starting bot...
"%PYTHON_VENV%" "%DIR%main.py"
echo Bot stopped.
pause