travis ci format check hotfix (#3449)

* set error message to be conditional

#3443 fails on the git merge base for "some reason" but at least this error message should be clearer.

* fix issues created earlier in #3433

split version from actual diff
remove --color-diff argument as apparently it isn't supported
This commit is contained in:
ebbit1q 2018-11-21 21:18:01 +01:00 committed by ctrlaltca
parent af2bce7141
commit ec61d1f012

View file

@ -36,6 +36,10 @@ while [[ "$@" ]]; do
shift
;;
*)
if [[ $1 == -* ]]; then
echo "unrecognized option: $1"
exit 3
fi
BUILDTYPE="$1"
shift
;;
@ -45,8 +49,8 @@ done
# Check formatting using clang-format
if [[ $CHECK_FORMAT ]]; then
echo "Checking your code using clang-format..."
if ! diff="$(./clangify.sh --color-diff --cf-version)"; then
cat <<EOM
if ! diff="$(./clangify.sh --diff --cf-version)"; then
[[ $? == 1 ]] && cat <<EOM
***********************************************************
*** ***
*** Your code does not comply with our styleguide. ***
@ -59,8 +63,13 @@ if [[ $CHECK_FORMAT ]]; then
*** ***
***********************************************************
Used clang-format version:
${diff%%
*}
The following changes should be made:
$diff
${diff#*
}
Exiting...
EOM