0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-27 00:21:11 +08:00
easy_profiler/scripts/make_style.sh
Sergey Yagovtsev cce8431484 Gramma fix #133
2018-10-04 13:10:42 +03:00

20 lines
433 B
Bash
Executable File

if [ "$#" -ne 1 ]; then
echo -e "Usage: \n$0 DIRECTORY\n\twhere DIRECTORY is a directory with sources for styling"
exit 1
fi
if ! [ -x "$(command -v clang-format)" ]; then
echo 'Error: clang-format is not installed. Please install clang-format with minimal version 3.8' >&2
exit 1
fi
DIR=$1
FILES=`find $DIR -name "*.h" -or -name "*.cpp"`
for FILE in $FILES
do
echo "Set style for $FILE"
clang-format -i $FILE
done