mirror of
https://github.com/golang/go
synced 2024-11-25 05:57:57 -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:
parent
6c651728d8
commit
799be52b35
@ -252,7 +252,14 @@ func doRun(argv []string, returnStdout bool) string {
|
|||||||
}
|
}
|
||||||
if runtime.GOOS == "windows" && argv[0] == "gomake" {
|
if runtime.GOOS == "windows" && argv[0] == "gomake" {
|
||||||
// gomake is a shell script and it cannot be executed directly on Windows.
|
// 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
|
var err os.Error
|
||||||
argv[0], err = exec.LookPath(argv[0])
|
argv[0], err = exec.LookPath(argv[0])
|
||||||
|
Loading…
Reference in New Issue
Block a user