diff options
| author | Garrett D'Amore <garrett@damore.org> | 2016-12-23 02:04:10 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2016-12-23 02:04:10 -0800 |
| commit | d708b178f049839bfdbaf0289e400363eac78a30 (patch) | |
| tree | 75aab8569509f93593379c9eed1135c42a77bc62 /etc | |
| parent | 72440b0d815b1b79941f3f58a47ec4df1ba1e0fc (diff) | |
| download | nng-d708b178f049839bfdbaf0289e400363eac78a30.tar.gz nng-d708b178f049839bfdbaf0289e400363eac78a30.tar.bz2 nng-d708b178f049839bfdbaf0289e400363eac78a30.zip | |
Don't error if uncrustify is not present (Mac images).
Don't colorize if stdout isn't a terminal.
Diffstat (limited to 'etc')
| -rwxr-xr-x | etc/uncrustify_check.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/etc/uncrustify_check.sh b/etc/uncrustify_check.sh index fc299650..aed05f61 100755 --- a/etc/uncrustify_check.sh +++ b/etc/uncrustify_check.sh @@ -18,6 +18,12 @@ mydir=`dirname $0` srcdir=${mydir}/../src failed= +uncrustify --version > /dev/null +if [ $? -ne 0 ]; then + echo "Uncrustify not found. Skipping checks." + exit 0 +fi + for file in `find ${srcdir} -name '*.[ch]' -print` do uncrustify -c "${mydir}/uncrustify.cfg" -q -lC $file @@ -25,7 +31,11 @@ do echo "Cannot run uncrustify??" 1>&2 exit 2 fi - colordiff -u $file $file.uncrustify + if [ -t 1 ]; then + colordiff -u $file $file.uncrustify + else + diff -u $file $file.uncrustify + fi if [ $? -ne 0 ]; then failed=1 fi |
