From e8701195e66f2d27ffe17fb514eae8173795aaf7 Mon Sep 17 00:00:00 2001 From: Georgiy Bondarenko <69736697+nehilo@users.noreply.github.com> Date: Thu, 4 Mar 2021 22:54:23 +0500 Subject: Initial commit --- buildroot/bin/format_code | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 buildroot/bin/format_code (limited to 'buildroot/bin/format_code') diff --git a/buildroot/bin/format_code b/buildroot/bin/format_code new file mode 100644 index 0000000..8ae04b1 --- /dev/null +++ b/buildroot/bin/format_code @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# format_code [dir/file...] +# + +HERE=`dirname $0` + +while [[ $# -gt 0 ]]; do + + val="$1" + + if [ -d "$val" ]; then + + find $val -name *.cpp -exec "$HERE/uncrust" '{}' \; + + elif [ -d "./Marlin/src/$val" ]; then + + find "./Marlin/src/$val" -name *.cpp -exec "$HERE/uncrust" '{}' \; + + elif [ -f "./Marlin/src/$val" ]; then + + uncrust "./Marlin/src/$val" + + elif [ -f "$val" ]; then + + uncrust "$val" + + fi + +done -- cgit v1.2.3