@echo off
setlocal
title Build CitiFox ERP macOS 14 arm64

for %%I in ("%~dp0.") do set "SCRIPT_DIR=%%~fI"
set "PS_SCRIPT=%SCRIPT_DIR%\build_mac_via_github_actions.ps1"

if not exist "%PS_SCRIPT%" (
  echo Missing script: %PS_SCRIPT%
  exit /b 1
)

powershell -NoProfile -ExecutionPolicy Bypass -File "%PS_SCRIPT%" %*
set "EXIT_CODE=%ERRORLEVEL%"

if not "%EXIT_CODE%"=="0" (
  echo.
  echo Script failed with exit code %EXIT_CODE%.
  exit /b %EXIT_CODE%
)

echo.
echo Done.
