@echo off
setlocal
chcp 65001 >nul 2>&1
set "ROOT=%~dp0"
if "%ROOT:~-1%"=="\" set "ROOT=%ROOT:~0,-1%"
cd /d "%ROOT%"

echo ========================================
echo   YMhut Box - WinUI 3 Build
echo ========================================
echo.

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%ROOT%\scripts\build-winui.ps1" %*
set "EXITCODE=%ERRORLEVEL%"
if not "%EXITCODE%"=="0" (
  echo.
  echo [ERROR] WinUI build failed with exit code %EXITCODE%.
)
exit /b %EXITCODE%
