-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
49 lines (42 loc) · 894 Bytes
/
Copy pathstart.bat
File metadata and controls
49 lines (42 loc) · 894 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
39
40
41
42
43
44
45
46
47
48
49
@echo off
setlocal EnableExtensions
cd /d "%~dp0"
where python >nul 2>&1
if errorlevel 1 (
where py >nul 2>&1
if errorlevel 1 (
echo ERROR: Python was not found on PATH.
echo Install Python 3.11+ and try again.
pause
exit /b 1
)
set "PY=py -3"
) else (
set "PY=python"
)
if not exist ".venv\Scripts\python.exe" (
echo Creating virtual environment...
%PY% -m venv .venv
if errorlevel 1 (
echo ERROR: Failed to create .venv
pause
exit /b 1
)
)
echo Installing dependencies...
".venv\Scripts\python.exe" -m pip install -r requirements.txt
if errorlevel 1 (
echo ERROR: pip install failed
pause
exit /b 1
)
set PYTHONDONTWRITEBYTECODE=1
echo Starting ShitPostGateWayBot...
".venv\Scripts\python.exe" -m bot
set "EXITCODE=%ERRORLEVEL%"
if not "%EXITCODE%"=="0" (
echo.
echo Bot exited with code %EXITCODE%.
pause
)
exit /b %EXITCODE%