Alex Brainman | 7a4d744 | 2012-02-20 12:17:27 +1100 | [diff] [blame] | 1 | :: Copyright 2012 The Go Authors. All rights reserved. |
| 2 | :: Use of this source code is governed by a BSD-style |
| 3 | :: license that can be found in the LICENSE file. |
| 4 | @echo off |
| 5 | |
| 6 | setlocal |
| 7 | |
| 8 | set GOBUILDFAIL=0 |
| 9 | |
Shenghou Ma | 01187f7 | 2015-05-07 02:12:23 -0400 | [diff] [blame] | 10 | go tool dist env -w -p >env.bat |
Alex Brainman | 7a4d744 | 2012-02-20 12:17:27 +1100 | [diff] [blame] | 11 | if errorlevel 1 goto fail |
| 12 | call env.bat |
| 13 | del env.bat |
| 14 | echo. |
| 15 | |
| 16 | if exist %GOTOOLDIR%\dist.exe goto distok |
| 17 | echo cannot find %GOTOOLDIR%\dist; nothing to clean |
| 18 | goto fail |
| 19 | :distok |
| 20 | |
| 21 | "%GOBIN%\go" clean -i std |
Shenghou Ma | 01187f7 | 2015-05-07 02:12:23 -0400 | [diff] [blame] | 22 | "%GOBIN%\go" tool dist clean |
| 23 | "%GOBIN%\go" clean -i cmd |
Alex Brainman | 7a4d744 | 2012-02-20 12:17:27 +1100 | [diff] [blame] | 24 | |
| 25 | goto end |
| 26 | |
| 27 | :fail |
| 28 | set GOBUILDFAIL=1 |
| 29 | |
| 30 | :end |
| 31 | if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL% |