You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a vcs tool like hg, git, svn, bzr is not found, cmd/go should explain to the user
what to install.
See confusion at https://plus.google.com/u/0/115056313943520401920/posts/Xvmwe76BJMS
vcs.go currently has just:
// run1 is the generalized implementation of run and runOutput.
func (v *vcsCmd) run1(dir string, cmdline string, keyval []string, verbose bool)
([]byte, error) {
m := make(map[string]string)
for i := 0; i < len(keyval); i += 2 {
m[keyval[i]] = keyval[i+1]
}
args := strings.Fields(cmdline)
for i, arg := range args {
args[i] = expand(m, arg)
}
cmd := exec.Command(v.cmd, args...)
cmd.Dir = dir
if buildX {
fmt.Printf("cd %s\n", dir)
fmt.Printf("%s %s\n", v.cmd, strings.Join(args, " "))
}
var buf bytes.Buffer
cmd.Stdout = &buf
cmd.Stderr = &buf
err := cmd.Run()
out := buf.Bytes()
if err != nil {
if verbose || buildV {
fmt.Fprintf(os.Stderr, "# cd %s; %s %s\n", dir, v.cmd, strings.Join(args, " "))
os.Stderr.Write(out)
}
return nil, err
}
return out, nil
}
We are more helpful in at at least one other case, as precedent:
if toolIsWindows && toolName == "pprof" {
args = append([]string{"perl", toolPath}, args[1:]...)
var err error
toolPath, err = exec.LookPath("perl")
if err != nil {
fmt.Fprintf(os.Stderr, "go tool: perl not found\n")
setExitStatus(3)
return
}
}
The text was updated successfully, but these errors were encountered:
I think it already has a pretty clear message. What else would you suggest? Simply
adding another line like:
fmt.Fprintf(os.Stderr, "You most likely need to install %s", vcs.name)
The text was updated successfully, but these errors were encountered: