Add linux script

Not a lot of output compared to windows. It is assumed that linux users
have clang-format in the path.
This commit is contained in:
Vasily
2018-12-28 00:24:40 +01:00
parent c33e8f76e7
commit 4446af2a06
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
clang-format --version
if [ $? -eq 0 ]; then
echo "Clang-format found."
build_path="`dirname \"$0\"`"
project_path=$build_path/../..
find $project_path/src/ -regex '.*\.\(cpp\|h\)' -exec clang-format -style=file -i {} \; -exec echo "Iteration 1: {}" \;
find $project_path/src/ -regex '.*\.\(cpp\|h\)' -exec clang-format -style=file -i {} \; -exec echo "Iteration 2: {}" \;
echo "DONE"
else
echo "Could not find clang-format."
fi