From 3c21eb43e8211d16af9810833cfb963c8404fb42 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- 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...