Skip to content

Commit

Permalink
More informative exit message
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 2, 2016
1 parent 8b98ec2 commit 7245ff5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/baseline.sh
Expand Up @@ -8,7 +8,7 @@ if [[ $PYVER == '3.5' || $PYVER == '2.7' ]]; then
unzip 'v'$PYVER'.zip'
rm -rf baseline$PYVER
mv invariant-builds-$PYVER baseline
rm 'v'$i'.zip'
rm 'v'$PYVER'.zip'
fi
else
echo -e "\033[35m>> Version $PYVER does not support baseline testing.\033[0m"
Expand All @@ -20,12 +20,14 @@ cp ../tests/data/1-nolinks.rst posts/1.rst
rm "stories/creating-a-theme.rst" "stories/extending.txt" "stories/internals.txt" "stories/manual.rst" "stories/social_buttons.txt" "stories/theming.rst" "stories/path_handlers.txt" "stories/charts.txt"
LC_ALL='en_US.UTF-8' PYTHONHASHSEED=0 nikola build --invariant
if [[ "$1" == "check" ]]; then
echo "\033[36m>> Testing baseline...\033[0m"
echo -e "\033[36m>> Testing baseline...\033[0m"
diff -ubwr ../baseline output
if [[ $? == 0 ]]; then
echo -e "\033[32;1m>> OK\033[0m"
echo -e "\033[32;1m>> Baseline test successful\033[0m"
else
echo -e "\033[31;1m>> Failed with exit code $?\033[0m"
exit 1
CODE=$?
echo -e "\033[31;1m>> Failed with exit code $CODE\033[0m"
echo "If this change was intentional, the baseline site needs to be rebuilt (maintainers only). Otherwise, please fix this issue."
exit $CODE
fi
fi

0 comments on commit 7245ff5

Please sign in to comment.