Commit 56517aed authored by Gustavo Franco's avatar Gustavo Franco Committed by Brad Fitzpatrick

cmd/go: add helpful error message when vcs is not found.

Fixes #4652.

R=bradfitz, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/7094049
parent aa0b573a
......@@ -180,6 +180,14 @@ func (v *vcsCmd) run1(dir string, cmdline string, keyval []string, verbose bool)
args[i] = expand(m, arg)
}
_, err := exec.LookPath(v.cmd)
if err != nil {
fmt.Fprintf(os.Stderr,
"go: missing %s command. See http://golang.org/s/gogetcmd\n",
v.name)
return nil, err
}
cmd := exec.Command(v.cmd, args...)
cmd.Dir = dir
if buildX {
......@@ -189,7 +197,7 @@ func (v *vcsCmd) run1(dir string, cmdline string, keyval []string, verbose bool)
var buf bytes.Buffer
cmd.Stdout = &buf
cmd.Stderr = &buf
err := cmd.Run()
err = cmd.Run()
out := buf.Bytes()
if err != nil {
if verbose || buildV {
......
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