Skip to content

Commit 921b974

Browse files
committed
Don't fail build when xcpretty is missing or noisy
1 parent 5b7fc34 commit 921b974

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

scripts/build.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# Build Claude Island for release
3-
set -eo pipefail
3+
set -e
44

55
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
66
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
@@ -17,16 +17,22 @@ mkdir -p "$BUILD_DIR"
1717

1818
cd "$PROJECT_DIR"
1919

20-
# Build and archive
20+
# Build and archive — pipe to xcpretty when available, but capture the real
21+
# xcodebuild exit code so a noisy-but-successful xcpretty doesn't fail the build.
2122
echo "Archiving..."
23+
set +e
2224
xcodebuild archive \
2325
-scheme ClaudeIsland \
2426
-configuration Release \
2527
-archivePath "$ARCHIVE_PATH" \
2628
-destination "generic/platform=macOS" \
2729
ENABLE_HARDENED_RUNTIME=YES \
2830
CODE_SIGN_STYLE=Automatic \
29-
2>&1 | xcpretty || {
31+
2>&1 | xcpretty
32+
ARCHIVE_EXIT=${PIPESTATUS[0]}
33+
set -e
34+
35+
if [ "$ARCHIVE_EXIT" -ne 0 ]; then
3036
echo "ERROR: Archive failed. Re-running with full output..."
3137
xcodebuild archive \
3238
-scheme ClaudeIsland \
@@ -36,7 +42,7 @@ xcodebuild archive \
3642
ENABLE_HARDENED_RUNTIME=YES \
3743
CODE_SIGN_STYLE=Automatic
3844
exit 1
39-
}
45+
fi
4046

4147
# Create ExportOptions.plist if it doesn't exist
4248
EXPORT_OPTIONS="$BUILD_DIR/ExportOptions.plist"
@@ -58,18 +64,23 @@ EOF
5864
# Export the archive
5965
echo ""
6066
echo "Exporting..."
67+
set +e
6168
xcodebuild -exportArchive \
6269
-archivePath "$ARCHIVE_PATH" \
6370
-exportPath "$EXPORT_PATH" \
6471
-exportOptionsPlist "$EXPORT_OPTIONS" \
65-
2>&1 | xcpretty || {
72+
2>&1 | xcpretty
73+
EXPORT_EXIT=${PIPESTATUS[0]}
74+
set -e
75+
76+
if [ "$EXPORT_EXIT" -ne 0 ]; then
6677
echo "ERROR: Export failed. Re-running with full output..."
6778
xcodebuild -exportArchive \
6879
-archivePath "$ARCHIVE_PATH" \
6980
-exportPath "$EXPORT_PATH" \
7081
-exportOptionsPlist "$EXPORT_OPTIONS"
7182
exit 1
72-
}
83+
fi
7384

7485
echo ""
7586
echo "=== Build Complete ==="

0 commit comments

Comments
 (0)