diff --git a/packages/react-native-editor/bin/build_e2e_ios_app b/packages/react-native-editor/bin/build_e2e_ios_app index f47c8c3d4902c0..282bc2c86ef075 100755 --- a/packages/react-native-editor/bin/build_e2e_ios_app +++ b/packages/react-native-editor/bin/build_e2e_ios_app @@ -7,12 +7,21 @@ else DESTINATION="$RN_EDITOR_E2E_IOS_DESTINATION" fi -# Script that encapsulates the xcodebuild call to build the app for E2E testing -# to allow customizing the destination argument without hardcoding a value -SKIP_BUNDLING=true \ +# Define xcodebuild in a variable so that we can conditionally pipe it through +# the xcbeautify output parser +XCODEBUILD_CMD="SKIP_BUNDLING=true \ xcodebuild \ -workspace ios/GutenbergDemo.xcworkspace \ -configuration Release \ -scheme GutenbergDemo \ -derivedDataPath ios/build/GutenbergDemo \ - -destination "$DESTINATION" + -destination '$DESTINATION'" + +# Check if xcbeautify is available +if command -v xcbeautify >/dev/null 2>&1; then + # Pipe the output to xcbeautify + eval "$XCODEBUILD_CMD" | xcbeautify +else + # Run xcodebuild without piping the output + eval "$XCODEBUILD_CMD" +fi