Fix CI clang-format script to tell if clang-format cannot be found (#3450)

This commit is contained in:
theohax 2021-09-16 15:19:11 +03:00 committed by GitHub
commit 75149ef6b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,12 @@
set -e
REPO_ROOT=$(git rev-parse --show-toplevel)
cd "${REPO_ROOT}"
./ci/update-clang-format
find nano -iname '*.h' -o -iname '*.hpp' -o -iname '*.cpp' | xargs clang-format -i
CLANG_FORMAT="clang-format"
if [ $(builtin type -p "$CLANG_FORMAT") ]; then
REPO_ROOT=$(git rev-parse --show-toplevel)
cd "$REPO_ROOT"
./ci/update-clang-format
find nano -iname '*.h' -o -iname '*.hpp' -o -iname '*.cpp' | xargs "$CLANG_FORMAT" -i
else
echo "'$CLANG_FORMAT' could not be detected in your PATH. Do you have it installed?"
fi