From 4446af2a06e8d2016cadf2c49c0962222994c1f5 Mon Sep 17 00:00:00 2001 From: Vasily Date: Fri, 28 Dec 2018 00:24:40 +0100 Subject: [PATCH] Add linux script Not a lot of output compared to windows. It is assumed that linux users have clang-format in the path. --- build_scripts/linux/format | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 build_scripts/linux/format diff --git a/build_scripts/linux/format b/build_scripts/linux/format new file mode 100644 index 0000000..36f978c --- /dev/null +++ b/build_scripts/linux/format @@ -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 +