Browse Source

Improve uncrust script

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
f587a4e3f3
  1. 11
      buildroot/bin/uncrust

11
buildroot/bin/uncrust

@ -6,11 +6,12 @@
TMPDIR=`mktemp -d` TMPDIR=`mktemp -d`
# Reformat a single file to tmp/ # Reformat a single file to tmp/
uncrustify -l CPP -c ./buildroot/share/extras/uncrustify.cfg -f "$1" >$TMPDIR/uncrustify.out if uncrustify -l CPP -c ./buildroot/share/extras/uncrustify.cfg -f "$1" >$TMPDIR/uncrustify.out ; then
cp "$TMPDIR/uncrustify.out" "$1" ; # Replace the original file
# Replace the original file else
cp "$TMPDIR/uncrustify.out" "$1" echo "Something went wrong with uncrustify."
fi
# Clean up, deliberately # Clean up, deliberately
rm "$TMPDIR/uncrustify.out" [[ -f "$TMPDIR/uncrustify.out" ]] && rm "$TMPDIR/uncrustify.out"
rmdir "$TMPDIR" rmdir "$TMPDIR"

Loading…
Cancel
Save