[PATCH] BaseTools: Reset ERRORLEVEL in toolsetup.bat after edk2basetools check


Rebecca Cran
 

When using the in-source BaseTools, edksetup.bat will exit with an
ERRORLEVEL of 1 because the line in toolsetup.bat
"%PYTHON_COMMAND% -c "import edk2basetools" >NUL 2>NUL"
fails.

Ensure ERRORLEVEL is set to 0 when edksetup.bat or toolsetup.bat is
successfully run.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
BaseTools/toolsetup.bat | 2 ++
1 file changed, 2 insertions(+)

diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
index a766a69f08..ca8bfdd677 100755
--- a/BaseTools/toolsetup.bat
+++ b/BaseTools/toolsetup.bat
@@ -401,6 +401,8 @@ goto end
if %ERRORLEVEL% EQU 0 (=0D
goto use_pip_basetools=0D
) else (=0D
+ REM reset ERRORLEVEL=0D
+ type nul>nul=0D
goto use_builtin_basetools=0D
)=0D
=0D
--=20
2.32.0

Join devel@edk2.groups.io to automatically receive all group messages.