-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlaunch_bilibili.bat
More file actions
49 lines (44 loc) · 1.37 KB
/
launch_bilibili.bat
File metadata and controls
49 lines (44 loc) · 1.37 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
@echo off
setlocal EnableExtensions
chcp 65001 >nul
title Launch NachoBot Bilibili
set "PYTHONNOUSERSITE=1"
set "ROOT=%~dp0"
set "BILIBILI_DIR=%ROOT%NachoBot-Bilibili-Adapter"
set "NACHOBOT_DIR=%ROOT%NachoBot"
REM ===== check and install uv =====
where uv >nul 2>&1
if errorlevel 1 (
echo [INFO] uv not found, auto installing...
powershell -NoProfile -ExecutionPolicy ByPass -Command "irm https://astral.sh/uv/install.ps1 | iex"
if errorlevel 1 (
echo [ERROR] uv install failed. Please install manually using pip install uv.
pause
exit /b 1
)
set "PATH=%USERPROFILE%\.local\bin;%USERPROFILE%\.cargo\bin;%PATH%"
where uv >nul 2>&1
if errorlevel 1 (
echo [ERROR] uv installed but not found in PATH. Please restart terminal.
pause
exit /b 1
)
echo [OK] uv installed!
)
REM ===== sync deps =====
echo [SYNC] NachoBot ...
cd /d "%NACHOBOT_DIR%"
uv sync
if errorlevel 1 echo [WARN] NachoBot uv sync failed.
echo [SYNC] NachoBot-Bilibili-Adapter ...
cd /d "%BILIBILI_DIR%"
uv sync
if errorlevel 1 echo [WARN] Bilibili Adapter uv sync failed.
REM ===== start Bilibili Adapter =====
echo.
echo [START] NachoBot-Bilibili-Adapter ...
start "NachoBot-Bilibili" /D "%BILIBILI_DIR%" cmd /k "chcp 65001>nul && set PYTHONPATH=%NACHOBOT_DIR%;%BILIBILI_DIR% && uv run --project ""%NACHOBOT_DIR%"" python main.py"
echo.
echo [DONE] Launch sequence complete.
echo.
endlocal