Commit 4d249433 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

cmd/api: don't fail API check if there's no network

If the hg checkout of go.tools fails, check for Internet
connectivity before failing.

R=golang-dev, shivakumar.gn
CC=golang-dev
https://golang.org/cl/12814043
parent 4984e6e9
......@@ -16,6 +16,7 @@ package main
import (
"fmt"
"log"
"net/http"
"os"
"os/exec"
"path/filepath"
......@@ -109,6 +110,10 @@ func prepGoPath() string {
cmd.Dir = cloneDir
out, err := cmd.CombinedOutput()
if err != nil {
if _, err := http.Head("http://ip.appspot.com/"); err != nil {
log.Printf("# Skipping API check; network appears to be unavailable")
os.Exit(0)
}
log.Fatalf("Error running hg clone on go.tools: %v\n%s", err, out)
}
if err := os.Rename(tmpDir, finalDir); err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment