summaryrefslogtreecommitdiffstats
path: root/bin/format_source_patch
blob: 4c531eadcc16fe3e70d11fc5c5faf18992470a5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/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