You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
700 B

#!/bin/bash
DIR=$1
13 years ago
COMMIT=$2
function do_commit {
if [ $COMMIT == 1 ] ;then
git commit $1 --author="uncrustify <pat@moreproductive.org>" \
--message="uncrustify $1";
13 years ago
fi
}
function format_cpp {
echo 'format_cpp' $1
uncrustify --no-backup -c uncrustify_cpp.cfg $1
13 years ago
do_commit $1
}
function format_header {
echo 'format_header' $1
uncrustify --no-backup -c uncrustify_headers.cfg $1
13 years ago
do_commit $1
}
PDEFILES=`find $DIR -name '*.pde' -print`
CPPFILES=`find $DIR -name '*.cpp' -print`
CFILES=`find $DIR -name '*.c' -print`
HFILES=`find $DIR -name '*.h' -print`
for f in $PDEFILES $CPPFILES $CFILES; do
format_cpp $f
done
for f in $HFILES; do
format_header $f
done