diff --git a/scripts/common.sh b/scripts/common.sh index 33666350..6408731b 100755 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -124,7 +124,6 @@ function action() { DESTINATION='platform=OS X,arch=x86_64' fi - STATUS="" set -x killall Simulator || true xcodebuild -workspace "${WORKSPACE}" \ @@ -132,9 +131,13 @@ function action() { -configuration "${CONFIGURATION}" \ -derivedDataPath "${BUILD_DIRECTORY}" \ -destination "$DESTINATION" \ - $ACTION | tee build/last-build-output.txt | xcpretty -c; STATUS=${PIPESTATUS[0]} + $ACTION | tee build/last-build-output.txt | xcpretty -c + exitIfLastStatusWasUnsuccessful set +x +} +function exitIfLastStatusWasUnsuccessful() { + STATUS=${PIPESTATUS[0]} if [ $STATUS -ne 0 ]; then echo $STATUS exit $STATUS diff --git a/scripts/release-prep.sh b/scripts/release-prep.sh index 7bc1831c..4792219b 100755 --- a/scripts/release-prep.sh +++ b/scripts/release-prep.sh @@ -1,5 +1,10 @@ +. scripts/common.sh + # run tests . scripts/pre-release-tests.sh # update jazzy documentation config +printf "${GREEN}Updating .jazzy.yml${RESET}\n" ./scripts/update-jazzy-config.rb +exitIfLastStatusWasUnsuccessful +printf "${GREEN}Successfully updated .jazzy.yml${RESET}\n" diff --git a/scripts/update-jazzy-config.rb b/scripts/update-jazzy-config.rb index 3b5c629a..eb6c386f 100755 --- a/scripts/update-jazzy-config.rb +++ b/scripts/update-jazzy-config.rb @@ -2,6 +2,12 @@ require 'yaml' +jazzy_dep = Gem::Dependency.new('jazzy') +found_jazzy = jazzy_dep.matching_specs +if found_jazzy.empty? + Kernel.abort('jazzy gem not found. Please install it and then try again.') +end + included_directories = %w(RxSwift RxCocoa) files_and_directories = included_directories.collect do |directory|