2015-01-06 00:16:30 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2016-04-21 18:29:49 -03:00
|
|
|
file=$1
|
|
|
|
|
|
|
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
|
|
|
|
|
|
|
if [ -f "$file" ];
|
|
|
|
then
|
|
|
|
${DIR}/fix_code_style.sh --quiet < $file > $file.pretty
|
|
|
|
diffsize=$(diff -y --suppress-common-lines $file $file.pretty | wc -l)
|
|
|
|
rm -f $file.pretty
|
|
|
|
if [ $diffsize -ne 0 ]; then
|
|
|
|
echo $file 'bad formatting, please run "./Tools/fix_code_style.sh' $file'"'
|
2015-01-06 00:16:30 -04:00
|
|
|
exit 1
|
2016-04-21 18:29:49 -03:00
|
|
|
fi
|
2015-01-06 00:16:30 -04:00
|
|
|
fi
|
2016-04-21 18:29:49 -03:00
|
|
|
|