check_formatting: skip reformat-source if not available
Previously check_formatting is aborted if clang-format is not found.
After this commit the behaviour of missing cmake_format is replicated
and only the portion that is relying on the command is skipped.
@@ -5,7 +5,6 @@ echo ELEKTRA CHECK FORMATTING
echo
command -v git >/dev/null 2>&1 || { echo "git command needed for this test, aborting" >&2; exit 0; }
-command -v clang-format-5.0 >/dev/null 2>&1 || command -v clang-format >/dev/null 2>&1 || { echo "clang-format command needed for this test, aborting" >&2; exit 0; }
cd "@CMAKE_SOURCE_DIR@"
@@ -15,7 +14,12 @@ then
exit 0
fi
+if which clang-format-5.0 > /dev/null || which clang-format > /dev/null
+then
scripts/reformat-source
+else
+ echo 'Warning: clang-format not available, skipping reformat-source'
+fi
if which sponge > /dev/null && which cmake-format > /dev/null
then
