Added script to automatically format all changed .c and .h files.

This commit is contained in:
Armin Novak 2014-08-19 18:25:37 +02:00
parent a15df299e9
commit a145c4201f

10
scripts/autoformat.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
CHANGESET=`git status | cut -d ':' -f 2 | grep -vE "#|no" | grep -E "*\.h|*\.c"` # get filenames from git status
for f in $CHANGESET; do
if [ -e $f ]; then
sh $MY_PATH/format_code.sh $f
fi
done