Skip to content

Commit

Permalink
Merge pull request #18 from gkiki90/master
Browse files Browse the repository at this point in the history
code cleaning
  • Loading branch information
viktorbenei committed Sep 30, 2015
2 parents 17ba418 + 784dd4a commit 62f5aab
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions step.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ const timeOutMessageIPhoneSimulator = "iPhoneSimulator: Timed out waiting"
// with Xcode Command Line `xcodebuild`.
const timeOutMessageUITest = "Terminating app due to uncaught exception '_XCTestCaseInterruptionException'"

const xcodeVersionPrefix = "Xcode "

func exportEnvironmentWithEnvman(keyStr, valueStr string) error {
log.Printf("Exporting: %s", keyStr)
envman := exec.Command("envman", "add", "--key", keyStr)
Expand All @@ -35,18 +33,14 @@ func exportEnvironmentWithEnvman(keyStr, valueStr string) error {
}

func getXcodeVersion() (string, error) {
outBuffer := bytes.Buffer{}
errBuffer := bytes.Buffer{}

cmd := exec.Command("xcodebuild", "-version")
cmd.Stdout = io.Writer(&outBuffer)
cmd.Stderr = io.Writer(&errBuffer)

if err := cmd.Run(); err != nil {
return "", fmt.Errorf("xcodebuild -version failed, err: %s, details: %s", err, errBuffer.String())
outBytes, err := cmd.CombinedOutput()
if err != nil {
return "", fmt.Errorf("xcodebuild -version failed, err: %s, details: %s", err, string(outBytes))
}

return outBuffer.String(), nil
return string(outBytes), nil
}

func printConfig(projectPath, scheme, simulatorDevice, simulatorOsVersion, action, deviceDestination string, cleanBuild bool) {
Expand Down

0 comments on commit 62f5aab

Please sign in to comment.