@echo off
setlocal EnableExtensions
cd /d "%~dp0.."
title NexaOffice - Cleanup Build Artifacts

echo ============================================
echo NexaOffice Cleanup Build Artifacts
echo ============================================
echo.
echo This removes temporary build folders and old build backups.
echo It will NOT remove the current dist folder.
echo.
choice /C YN /M "Continue cleanup"
if errorlevel 2 exit /b 0

for /d %%F in ("dist_new_*" "build_new_*") do (
  if exist "%%~fF" rmdir /S /Q "%%~fF" >nul 2>nul
)

if exist "build_backups" (
  rmdir /S /Q "build_backups" >nul 2>nul
)

for /d /r . %%d in (__pycache__) do @if exist "%%d" rmdir /S /Q "%%d" >nul 2>nul

echo.
echo Cleanup done.
pause
