Unsuccessfully exit from script if jazzy gem isn't found

This commit is contained in:
Jesse Farless 2016-06-08 15:45:29 +02:00
parent 3ebb38c681
commit 6d84f30338
3 changed files with 16 additions and 2 deletions

View File

@ -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

View File

@ -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"

View File

@ -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|