1
0
mirror of https://github.com/golang/go synced 2024-11-06 07:36:13 -07:00
go/src/run.bat
Yasuhiro Matsumoto c4c9c80e4f all.bat,clean.bat,race.bat,run.bat: call some.bat with .\some.bat
When set NoDefaultCurrentDirectoryInExePath=1, call some.bat does not work.

Change-Id: Ifeab27ecf0d7ba1d504b755a22f73a0f13abbbb3
Reviewed-on: https://go-review.googlesource.com/c/go/+/405874
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2022-05-12 16:59:17 +00:00

42 lines
844 B
Batchfile

:: Copyright 2012 The Go Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style
:: license that can be found in the LICENSE file.
@echo off
if exist ..\bin\go.exe goto ok
echo Must run run.bat from Go src directory after installing cmd/go.
goto fail
:ok
:: 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
..\bin\go tool dist env > env.bat
if errorlevel 1 goto fail
call .\env.bat
del env.bat
set GOPATH=c:\nonexist-gopath
if x%1==x--no-rebuild goto norebuild
..\bin\go tool dist test --rebuild
if errorlevel 1 goto fail
goto end
:norebuild
..\bin\go tool dist test
if errorlevel 1 goto fail
goto end
:fail
set GOBUILDFAIL=1
:end