@echo off
rem Desktop shortcut target: run the daily refresh and keep the window open.
setlocal EnableExtensions
cd /d "%~dp0.."
echo ============================================================
echo  Daily refresh: M1 -^> M2 -^> dashboard -^> market catalog
echo  Takes about 15-25 minutes. Do not close this window.
echo ============================================================
echo.
call "%~dp0daily_all.cmd"
set "RC=%errorlevel%"
echo.
echo ============================================================
if "%RC%"=="0" (echo  DONE - refresh succeeded, exit code 0) else (echo  FAILED - exit code %RC%)
echo ============================================================
echo.
echo Running health check...
echo.
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0health_check.ps1"
echo.
pause
exit /b %RC%
