Skip to content

Commit c86330c

Browse files
authored
Fix reverting to xcodebuild on xcpretty error (#41)
1 parent 35c2a4f commit c86330c

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

step.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ package main
22

33
import (
44
"fmt"
5+
"os"
6+
"path"
7+
"path/filepath"
8+
"strings"
9+
510
"github.com/bitrise-io/go-steputils/stepconf"
611
"github.com/bitrise-io/go-steputils/tools"
712
"github.com/bitrise-io/go-utils/errorutil"
@@ -21,10 +26,6 @@ import (
2126
"github.com/bitrise-steplib/steps-xcode-archive/utils"
2227
"github.com/bitrise-steplib/steps-xcode-build-for-simulator/util"
2328
"github.com/kballard/go-shellquote"
24-
"os"
25-
"path"
26-
"path/filepath"
27-
"strings"
2829
)
2930

3031
const (
@@ -115,7 +116,9 @@ func (b BuildForSimulatorStep) InstallDependencies(cfg Config) (Config, error) {
115116
log.Warnf("%s failed: %s", err)
116117
}
117118
log.Warnf("Switching to xcodebuild for output tool")
118-
outputTool = "xcodebuild"
119+
120+
cfg.OutputTool = "xcodebuild"
121+
return cfg, nil
119122
}
120123
}
121124
}
@@ -124,10 +127,12 @@ func (b BuildForSimulatorStep) InstallDependencies(cfg Config) (Config, error) {
124127
if err != nil {
125128
log.Warnf("Failed to determine xcpretty version, error: %s", err)
126129
log.Printf("Switching to xcodebuild for output tool")
127-
outputTool = "xcodebuild"
130+
131+
cfg.OutputTool = "xcodebuild"
132+
return cfg, nil
128133
}
129-
log.Printf("- xcprettyVersion: %s", xcprettyVersion.String())
130134

135+
log.Printf("- xcprettyVersion: %s", xcprettyVersion.String())
131136
cfg.OutputTool = outputTool
132137
return cfg, nil
133138
}

0 commit comments

Comments
 (0)