2017-02-02 03:28:22 +08:00
|
|
|
#/usr/bin/env bash
|
|
|
|
|
|
|
|
clang_format=`bash -c "compgen -c clang-format | grep 'clang-format-[[:digit:]]' | sort --version-sort --reverse | head -n1"`
|
|
|
|
if [ ! -z $clang_format ]; then
|
2017-04-05 19:52:23 +08:00
|
|
|
find dbms libs utils -name *.cpp -or -name *.h -exec $clang_format -i {} + ;
|
2017-02-02 03:28:22 +08:00
|
|
|
else
|
2017-04-05 19:52:23 +08:00
|
|
|
echo clang-format missing. try to install:
|
|
|
|
echo sudo apt install clang-format
|
|
|
|
echo or
|
|
|
|
echo sudo apt install clang-format-3.9
|
2017-02-02 03:28:22 +08:00
|
|
|
fi
|