Fix CI clang-format script to tell if clang-format cannot be found (#3450)
This commit is contained in:
parent
4e2ffe9993
commit
75149ef6b5
1 changed files with 9 additions and 4 deletions
|
|
@ -2,7 +2,12 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
CLANG_FORMAT="clang-format"
|
||||||
|
if [ $(builtin type -p "$CLANG_FORMAT") ]; then
|
||||||
REPO_ROOT=$(git rev-parse --show-toplevel)
|
REPO_ROOT=$(git rev-parse --show-toplevel)
|
||||||
cd "${REPO_ROOT}"
|
cd "$REPO_ROOT"
|
||||||
./ci/update-clang-format
|
./ci/update-clang-format
|
||||||
find nano -iname '*.h' -o -iname '*.hpp' -o -iname '*.cpp' | xargs clang-format -i
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue