-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch.cmd
More file actions
32 lines (25 loc) · 810 Bytes
/
launch.cmd
File metadata and controls
32 lines (25 loc) · 810 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
@echo off
setlocal EnableExtensions
title Tele-Bot
cd /d "%~dp0"
set "BUN_EXE="
where bun >nul 2>nul
if %errorlevel% equ 0 set "BUN_EXE=bun"
if not defined BUN_EXE if exist "%LOCALAPPDATA%\bun\bin\bun.exe" set "BUN_EXE=%LOCALAPPDATA%\bun\bin\bun.exe"
if not defined BUN_EXE if exist "%ProgramFiles%\Bun\bin\bun.exe" set "BUN_EXE=%ProgramFiles%\Bun\bin\bun.exe"
if not defined BUN_EXE if exist "%ProgramFiles(x86)%\Bun\bin\bun.exe" set "BUN_EXE=%ProgramFiles(x86)%\Bun\bin\bun.exe"
if not defined BUN_EXE (
echo Could not find Bun.
echo Install Bun or add it to PATH, then try again.
pause
exit /b 1
)
echo Starting Tele-Bot from %CD%
%BUN_EXE% run start
set "EXIT_CODE=%errorlevel%"
if not "%EXIT_CODE%"=="0" (
echo.
echo Tele-Bot exited with code %EXIT_CODE%.
pause
)
exit /b %EXIT_CODE%