2019-01-18 15:19:53 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Format almost all code with current clang-format settings
|
|
|
|
|
|
|
|
cd `readlink -f $(dirname $0)`/../..
|
2017-02-01 19:28:22 +00:00
|
|
|
|
|
|
|
clang_format=`bash -c "compgen -c clang-format | grep 'clang-format-[[:digit:]]' | sort --version-sort --reverse | head -n1"`
|
|
|
|
if [ ! -z $clang_format ]; then
|
2020-08-12 03:03:47 +00:00
|
|
|
find base src programs utils -name *.cpp -or -name *.h -exec $clang_format -i {} + ;
|
2017-02-01 19:28:22 +00:00
|
|
|
else
|
2017-04-05 11:52:23 +00:00
|
|
|
echo clang-format missing. try to install:
|
|
|
|
echo sudo apt install clang-format
|
|
|
|
echo or
|
2020-08-12 03:03:47 +00:00
|
|
|
echo sudo apt install clang-format-10
|
2017-02-01 19:28:22 +00:00
|
|
|
fi
|