1
0
mirror of https://github.com/golang/go synced 2024-11-22 01:54:42 -07:00

gotest: another attempt to make it run on Windows

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4347041
This commit is contained in:
Alex Brainman 2011-04-01 13:38:33 +11:00
parent 6c651728d8
commit 799be52b35

View File

@ -252,7 +252,14 @@ func doRun(argv []string, returnStdout bool) string {
}
if runtime.GOOS == "windows" && argv[0] == "gomake" {
// gomake is a shell script and it cannot be executed directly on Windows.
argv = append([]string{"cmd", "/c", "sh", "-c"}, strings.Join(argv, " "))
cmd := ""
for i, v := range argv {
if i > 0 {
cmd += " "
}
cmd += `"` + v + `"`
}
argv = []string{"cmd", "/c", "sh", "-c", cmd}
}
var err os.Error
argv[0], err = exec.LookPath(argv[0])