@echo off
setlocal

set "SCRIPT_DIR=%~dp0"
set "ENTRY=cli.js"

where bun >nul 2>nul && goto run_bun
where node >nul 2>nul && goto run_node
goto install_bun

:install_bun
echo Installing Bun...
powershell -NoProfile -ExecutionPolicy Bypass -Command "irm bun.sh/install.ps1 | iex"
set "PATH=%USERPROFILE%\.bun\bin;%PATH%"
goto run_bun

:run_bun
bun run "%ENTRY%" %*
goto :eof

:run_node
node "%ENTRY%" %*
goto :eof
