From 5fcd35fd66b2f70cd8d6388f1661fa9cff56ff1a Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Thu, 16 Aug 2012 17:37:45 -0700 Subject: [PATCH] real reformat.sh --- reformat.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reformat.sh b/reformat.sh index 14e7c48352..dd9dcaa87a 100755 --- a/reformat.sh +++ b/reformat.sh @@ -1,14 +1,24 @@ #!/bin/bash DIR=$1 +COMMIT=$2 + +function do_commit { + if [ $COMMIT == 1 ] ;then + git commit $1 --author="uncrustify " \ + --message="uncrustify"; + fi +} function format_cpp { echo 'format_cpp' $1 uncrustify --no-backup -c uncrustify_cpp.cfg $1 + do_commit $1 } function format_header { echo 'format_header' $1 uncrustify --no-backup -c uncrustify_headers.cfg $1 + do_commit $1 } PDEFILES=`find $DIR -name '*.pde' -print`