From beaa5717ba3a3e23b4f189d665e9fffb8143c0e3 Mon Sep 17 00:00:00 2001 From: djdv Date: Sat, 13 Aug 2022 17:32:26 +0000 Subject: [PATCH] make.bat: handle spaces in path when determining bootstrap version Single quotes don't account for whitespace in this context, which causes output to look like this: $ ./make.bat 'C:\Program' is not recognized as an internal or external command, operable program or batch file. Building Go cmd/dist using C:\Program Files\Go. (go version =) When it should look like this: Building Go cmd/dist using C:\Program Files\Go. (go1.19 windows/amd64) For #44505. Change-Id: I71328add5c74bd2829c0e23224cfa6252395ff2c GitHub-Last-Rev: a01fda6b5226c3f1898056d1104c8bf7fc58ef99 GitHub-Pull-Request: golang/go#54270 Reviewed-on: https://go-review.googlesource.com/c/go/+/421356 Reviewed-by: Dmitri Shuralyov Run-TryBot: Dmitri Shuralyov Reviewed-by: Alex Brainman Reviewed-by: Dmitri Shuralyov Auto-Submit: Dmitri Shuralyov TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- src/make.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/make.bat b/src/make.bat index 29a9cce888..fb3eba7c3b 100644 --- a/src/make.bat +++ b/src/make.bat @@ -93,7 +93,7 @@ setlocal set GOOS= set GOARCH= set GOEXPERIMENT= -for /f "tokens=*" %%g IN ('%GOROOT_BOOTSTRAP%\bin\go version') do (set GOROOT_BOOTSTRAP_VERSION=%%g) +for /f "tokens=*" %%g IN ('"%GOROOT_BOOTSTRAP%\bin\go" version') do (set GOROOT_BOOTSTRAP_VERSION=%%g) set GOROOT_BOOTSTRAP_VERSION=%GOROOT_BOOTSTRAP_VERSION:go version =% echo Building Go cmd/dist using %GOROOT_BOOTSTRAP%. (%GOROOT_BOOTSTRAP_VERSION%) if x%vflag==x-v echo cmd/dist