14 lines
307 B
Bash
14 lines
307 B
Bash
#!/bin/bash
|
|
find . -type d \( -path ./config \) -prune \
|
|
-o -iname *.h -o -iname *.c -o -iname *.cpp -o -iname *.hpp \
|
|
| xargs clang-format -style=file -i -fallback-style=none
|
|
|
|
git diff > clang_format.patch
|
|
|
|
# Delete if 0 size
|
|
if [ ! -s clang_format.patch ]
|
|
then
|
|
rm clang_format.patch
|
|
fi
|
|
|
|
exit 0 |