From 1d27a0fc5ce41b327f5277dac6a899c7f803f9a0 Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Thu, 4 Dec 2025 17:17:46 -0500 Subject: [PATCH] Fix batch file ERRORLEVEL syntax in nested conditionals Fixed "was unexpected at this time" error by capturing ERRORLEVEL values into variables before using them in nested if statements. This is required due to how batch file delayed expansion works. --- scripts/build.bat | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/build.bat b/scripts/build.bat index 3a6ff87..1c19bda 100644 --- a/scripts/build.bat +++ b/scripts/build.bat @@ -37,14 +37,16 @@ if %ERRORLEVEL% neq 0 ( echo 📥 Installing MinGW-w64 via winget... echo This may take a few minutes... winget install -e --id=MSYS2.MSYS2 + set MSYS2_INSTALL_RESULT=!ERRORLEVEL! - if !ERRORLEVEL! equ 0 ( + if !MSYS2_INSTALL_RESULT! equ 0 ( echo ✓ MSYS2 installed successfully! echo. echo 📦 Installing GCC toolchain... C:\msys64\usr\bin\bash.exe -lc "pacman -S --noconfirm mingw-w64-x86_64-gcc" + set GCC_INSTALL_RESULT=!ERRORLEVEL! - if !ERRORLEVEL! equ 0 ( + if !GCC_INSTALL_RESULT! equ 0 ( echo ✓ GCC installed successfully! echo. echo 🔧 Adding MinGW to PATH for this session...