@echo off
setlocal
cd /d "%~dp0"

where node >nul 2>&1
if errorlevel 1 (
  echo [ERROR] Node.js not found. Install Node.js 20+ first.
  pause
  exit /b 1
)

node pack.mjs
set EXIT_CODE=%ERRORLEVEL%

echo.
if not %EXIT_CODE%==0 (
  echo Pack failed.
  pause
  exit /b %EXIT_CODE%
)

pause
exit /b 0
