2021-12-01 16:08:28 +01:00
|
|
|
#!/bin/bash
|
|
|
|
if [[ ! -f README.md ]]; then
|
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
|
2022-05-13 11:37:58 +02:00
|
|
|
cmake_fmt="cmake-format"
|
2022-05-13 11:35:59 +02:00
|
|
|
if command -v ${cmake_fmt} &> /dev/null; then
|
2022-05-13 11:35:18 +02:00
|
|
|
cmake_fmt_cmd="${cmake_fmt} -i CMakeLists.txt"
|
2022-05-13 11:34:44 +02:00
|
|
|
eval ${cmake_fmt_cmd}
|
2022-05-13 11:35:59 +02:00
|
|
|
fi
|
2022-05-13 11:34:44 +02:00
|
|
|
|
2022-05-13 11:58:41 +02:00
|
|
|
file_selectors="-iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp"
|
|
|
|
find ./src ${file_selectors} | xargs clang-format --style=file -i
|
|
|
|
find ./hal ${file_selectors} | xargs clang-format --style=file -i
|
|
|
|
find ./tests ${file_selectors} | xargs clang-format --style=file -i
|