Commit ade6bcf1 authored by Elias Naur's avatar Elias Naur

misc/ios: ignore stderr from iOS tools

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/36059Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 3f459164
......@@ -33,7 +33,7 @@ func main() {
fname := f.Name()
defer os.Remove(fname)
out := combinedOutput(parseMobileProvision(mp))
out := output(parseMobileProvision(mp))
_, err = f.Write(out)
check(err)
check(f.Close())
......@@ -111,12 +111,12 @@ func plistExtract(fname string, path string) ([]byte, error) {
}
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)
......
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