On (at least) macOS 10.12, the `security cms` subcommand used by the
iOS detection script will output an error to stderr. The command
otherwise succeeds, but the extra line confuses a later parsing step.
To fix it, use only stdout and ignore stderr from every command run
by detect.go.
For the new iOS builders.
Change-Id: Iee426da7926d7f987ba1be061fa92ebb853ef53d
Reviewed-on: https://go-review.googlesource.com/36059
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
fname := f.Name()
defer os.Remove(fname)
- out := combinedOutput(parseMobileProvision(mp))
+ out := output(parseMobileProvision(mp))
_, err = f.Write(out)
check(err)
check(f.Close())
}
func getLines(cmd *exec.Cmd) [][]byte {
- out := combinedOutput(cmd)
+ out := output(cmd)
return bytes.Split(out, []byte("\n"))
}
-func combinedOutput(cmd *exec.Cmd) []byte {
- out, err := cmd.CombinedOutput()
+func output(cmd *exec.Cmd) []byte {
+ out, err := cmd.Output()
if err != nil {
fmt.Println(strings.Join(cmd.Args, "\n"))
fmt.Fprintln(os.Stderr, err)