Skip to content

Commit

Permalink
Fix build script error if running locally and xcpretty-travis-formatt…
Browse files Browse the repository at this point in the history
…er is not installed
  • Loading branch information
maicki committed Jun 3, 2016
1 parent 86deec4 commit 0d925c7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ trap trap_handler INT TERM EXIT

MODE="$1"

if type xcpretty-travis-formatter &> /dev/null; then
FORMATTER="-f $(xcpretty-travis-formatter)"
else
FORMATTER="-s"
fi

if [ "$MODE" = "tests" ]; then
echo "Building & testing AsyncDisplayKit."
pod install
Expand All @@ -25,7 +31,7 @@ if [ "$MODE" = "tests" ]; then
-scheme AsyncDisplayKit \
-sdk "$SDK" \
-destination "$PLATFORM" \
build test | xcpretty -f `xcpretty-travis-formatter`
build test | xcpretty $FORMATTER
trap - EXIT
exit 0
fi
Expand All @@ -45,7 +51,7 @@ if [ "$MODE" = "examples" ]; then
-scheme Sample \
-sdk "$SDK" \
-destination "$PLATFORM" \
build | xcpretty -f `xcpretty-travis-formatter`
build | xcpretty $FORMATTER
elif [ -f "${example}/Cartfile" ]; then
echo "Using Carthage"
local_repo=`pwd`
Expand All @@ -60,7 +66,7 @@ if [ "$MODE" = "examples" ]; then
-scheme Sample \
-sdk "$SDK" \
-destination "$PLATFORM" \
build | xcpretty -f `xcpretty-travis-formatter`
build | xcpretty $FORMATTER

cd ../..
fi
Expand All @@ -77,7 +83,7 @@ if [ "$MODE" = "life-without-cocoapods" ]; then
-scheme "Life Without CocoaPods" \
-sdk "$SDK" \
-destination "$PLATFORM" \
build | xcpretty -f `xcpretty-travis-formatter`
build | xcpretty $FORMATTER
trap - EXIT
exit 0
fi
Expand All @@ -90,7 +96,7 @@ if [ "$MODE" = "framework" ]; then
-scheme Sample \
-sdk "$SDK" \
-destination "$PLATFORM" \
build | xcpretty -f `xcpretty-travis-formatter`
build | xcpretty $FORMATTER
trap - EXIT
exit 0
fi
Expand Down

0 comments on commit 0d925c7

Please sign in to comment.