:: license that can be found in the LICENSE file.
@echo off
+setlocal
+
if exist make.bat goto ok
echo all.bat must be run from go\src
:: cannot exit: would kill parent command interpreter
goto end
:ok
-set GOOLDPATH=%PATH%
-
-call make.bat --no-banner
+call make.bat --no-banner --no-local
if %GOBUILDFAIL%==1 goto end
call run.bat --no-rebuild
if %GOBUILDFAIL%==1 goto end
go tool dist banner
:end
-set PATH=%GOOLDPATH%
if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%
:: license that can be found in the LICENSE file.
@echo off
+:: Keep environment variables within this script
+:: unless invoked with --no-local.
+if x%1==x--no-local goto nolocal
+if x%2==x--no-local goto nolocal
+setlocal
+:nolocal
+
set GOBUILDFAIL=0
if exist make.bat goto ok
:localbuild
echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH%
-set oldGOOS=%GOOS%
-set oldGOARCH=%GOARCH%
+setlocal
set GOOS=%GOHOSTOS%
set GOARCH=%GOHOSTARCH%
%GOTOOLDIR%\go_bootstrap install -v std
-set GOOS=%oldGOOS%
-set GOARCH=%oldGOARCH%
+endlocal
if errorlevel 1 goto fail
echo .
del %GOTOOLDIR%\go_bootstrap.exe
echo .
-if "x%1"=="x--no-banner" goto nobanner
+if x%1==x--no-banner goto nobanner
%GOTOOLDIR%\dist banner
:nobanner