Fix initializing BuildTools when the Platform environment variable is set (#24998)
authorElinor Fung <47805090+elinor-fung@users.noreply.github.com>
Thu, 6 Jun 2019 21:03:18 +0000 (14:03 -0700)
committerGitHub <noreply@github.com>
Thu, 6 Jun 2019 21:03:18 +0000 (14:03 -0700)
* Make build-test.cmd exit if init-tools.cmd fails

* Clear Platform variable before initializing BuildTools

build-test.cmd
init-tools.cmd

index e1400c4..39c38d4 100644 (file)
@@ -166,6 +166,9 @@ REM ===
 REM =========================================================================================
 
 call "%__ProjectDir%\init-tools.cmd"
+if NOT [%ERRORLEVEL%]==[0] (
+    exit /b %ERRORLEVEL%
+)
 @if defined _echo @echo on
 
 set "__ToolsDir=%__ProjectDir%\Tools"
index 32634ec..0905e91 100644 (file)
@@ -1,6 +1,10 @@
 @if not defined _echo @echo off
 setlocal
 
+:: Clear the 'Platform' environment variable for this session
+:: This avoids overriding the default value from BuildTools projects used for initialization
+set Platform=
+
 set INIT_TOOLS_LOG=%~dp0init-tools.log
 if [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0.packages
 if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools