add cmake-format command to shell script

This commit is contained in:
Robin Müller 2022-05-13 11:34:44 +02:00
parent 3046822e88
commit 994c7299b9
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -3,6 +3,12 @@ if [[ ! -f README.md ]]; then
cd ..
fi
cmake_fmt="python3 -m cmake-format"
if command -v ${cmake_fmt} &> /dev/null
cmake_fmt_cmd=${cmake_fmt} -i CMakeLists.txt
eval ${cmake_fmt_cmd}
then
find ./src -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
find ./hal -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
find ./tests -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i