From 53b493299ba62c3976ce6c9a3630a0db1fa7cda9 Mon Sep 17 00:00:00 2001 From: Seth Hamilton Date: Sat, 13 Sep 2025 22:39:39 -0500 Subject: [PATCH] trying to rewrite the bat files in light of delayed expansion... not going well. what is happening? I hate windows cmd shell --- activate.bat | 19 +++++-------------- build.bat | 2 +- export.bat | 1 + 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/activate.bat b/activate.bat index 53f0e81..535e029 100644 --- a/activate.bat +++ b/activate.bat @@ -1,23 +1,14 @@ -FOR /r "C:\Program Files\Microsoft Visual Studio" %%G IN (*vcvars64.bat) DO ( - SET "_file=%%G" - SET "_comp=%_file:\VC\=%" - IF NOT "%_comp%" == "%_file%" Call "%_file%" -) +SETLOCAL ENABLEDELAYEDEXPANSION FOR /r "C:\Program Files\Microsoft Visual Studio" %%G IN (*vcvars64.bat) DO ( SET "_file=%%G" - SET "_comp=%_file:\VC\=%" - IF NOT "%_comp%" == "%_file%" Call "%_file%" + SET "_comp=!_file:\VC\=!" + IF NOT "!_comp!" == "!_file!" "!_file!" ) FOR /r "C:\Program Files (x86)\Microsoft Visual Studio" %%G IN (*vcvars64.bat) DO ( SET "_file=%%G" - SET "_comp=%_file:\VC\=%" - IF NOT "%_comp%" == "%_file%" Call "%_file%" + SET "_comp=!_file:\VC\=!" + IF NOT "!_comp!" == "!_file!" "!_file!" ) -FOR /r "C:\Program Files (x86)\Microsoft Visual Studio" %%G IN (*vcvars64.bat) DO ( - SET "_file=%%G" - SET "_comp=%_file:\VC\=%" - IF NOT "%_comp%" == "%_file%" Call "%_file%" -) diff --git a/build.bat b/build.bat index be61f18..9d61fb7 100644 --- a/build.bat +++ b/build.bat @@ -3,7 +3,7 @@ SET flags=-Od -ZI IF "%1" == "release" ( SET flags=-O2 ) -@echo on +@ECHO on SET srcs=src\* mkdir bin obj cl %srcs% Ws2_32.lib -I inc %flags% -std:c++20 -MP -Fo:obj\\ -Fe:bin\\ diff --git a/export.bat b/export.bat index d8b041a..ec38502 100644 --- a/export.bat +++ b/export.bat @@ -1,3 +1,4 @@ +@ECHO off SETLOCAL ENABLEDELAYEDEXPANSION Echo [ > compile_commands.json