-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
82 lines (73 loc) · 1.89 KB
/
Copy pathstart.bat
File metadata and controls
82 lines (73 loc) · 1.89 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@echo off
chcp 65001 >nul
title ARONA Music Bot STARTER
set "VENV_DIR=.venv"
echo ================================
echo ARONA Music Bot STARTER
echo ================================
echo.
where python >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Python was not found on PATH.
echo [ERROR] Install Python and try again.
pause
exit /b 1
)
if not exist "%VENV_DIR%\Scripts\python.exe" (
echo [INFO] Creating virtual environment in "%VENV_DIR%"...
python -m venv "%VENV_DIR%"
if %errorlevel% neq 0 (
echo [ERROR] Failed to create the virtual environment.
pause
exit /b 1
)
echo [SUCCESS] Virtual environment created.
echo.
) else (
echo [INFO] Virtual environment already exists.
echo.
)
echo [INFO] Activating virtual environment...
call "%VENV_DIR%\Scripts\activate.bat"
if %errorlevel% neq 0 (
echo [ERROR] Failed to activate the virtual environment.
pause
exit /b 1
)
echo [SUCCESS] Virtual environment activated.
echo.
echo [INFO] Installing / updating packages from requirements.txt...
python -m pip install --upgrade pip
if %errorlevel% neq 0 (
echo [ERROR] Failed to upgrade pip.
pause
exit /b 1
)
python -m pip install -U -r requirements.txt
if %errorlevel% neq 0 (
echo [ERROR] Failed to install packages from requirements.txt.
pause
exit /b 1
)
echo [SUCCESS] Packages are ready.
echo.
if not exist "config.yaml" (
echo [WARN] config.yaml was not found.
echo [WARN] Copy config.default.yaml to config.yaml and set your bot token.
echo.
)
echo ================================
echo Starting ARONA...
echo ================================
echo.
python bot.py
set "EXIT_CODE=%errorlevel%"
echo.
echo ================================
echo ARONA has stopped.
echo ================================
if not "%EXIT_CODE%"=="0" (
echo [WARN] Bot exited with code %EXIT_CODE%.
)
pause
exit /b %EXIT_CODE%