Make uncrustify.sh more verbose on errors.
authorTeemu Murtola <teemu.murtola@gmail.com>
Sat, 14 Sep 2013 11:36:37 +0000 (14:36 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 19 Sep 2013 23:38:57 +0000 (01:38 +0200)
Capture the output of uncrustify instead of silencing it, and print it
out if uncrustify fails to run for any reason.

Change-Id: Iaefd89b586feb7e3148ad48a2b0f65d69ca7ac17

admin/uncrustify.sh

index 915c287e7315e843c78774b9076db4e0ee0dd3d0..aa6f1df3e60f7b7a9824c7f23c9a752d534d7ff3 100755 (executable)
@@ -180,8 +180,9 @@ fi
 # Run uncrustify on the temporary directory
 cd $tmpdir/org
 
-if ! $UNCRUSTIFY -c $cfg_file -F $tmpdir/filelist --prefix=../new/ -q ; then
-    echo "Reformatting failed!"
+if ! $UNCRUSTIFY -c $cfg_file -F $tmpdir/filelist --prefix=../new/ >$tmpdir/uncrustify.out 2>&1 ; then
+    echo "Reformatting failed. Check uncrustify output below for errors:"
+    cat $tmpdir/uncrustify.out
     rm -rf $tmpdir
     exit 2
 fi