Skip to content
8 changes: 4 additions & 4 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ esac
# Source function to check if CI secrets are available.
source scripts/check_secrets.sh

# Runs xcodebuild with the given flags, piping output to xcpretty
# Runs xcodebuild with the given flags, piping output to xcbeautify
# If xcodebuild fails with known error codes, retries once.
function RunXcodebuild() {
echo xcodebuild "$@"

xcpretty_cmd=(xcpretty)
xcbeautify_cmd=(xcbeautify --renderer github-actions)

result=0
xcodebuild "$@" | tee xcodebuild.log | "${xcpretty_cmd[@]}" || result=$?
xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" || result=$?

if [[ $result == 65 ]]; then
ExportLogs "$@"
Expand All @@ -122,7 +122,7 @@ function RunXcodebuild() {
sleep 5

result=0
xcodebuild "$@" | tee xcodebuild.log | "${xcpretty_cmd[@]}" || result=$?
xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" || result=$?
fi

if [[ $result != 0 ]]; then
Expand Down
Loading