uncrust 340 B

12345678910111213141516
  1. #!/usr/bin/env bash
  2. #
  3. # Run uncrustify for a file in-place
  4. #
  5. TMPDIR=`mktemp -d`
  6. # Reformat a single file to tmp/
  7. uncrustify -l CPP -c ./buildroot/share/extras/uncrustify.cfg -f "$1" >$TMPDIR/uncrustify.out
  8. # Replace the original file
  9. cp "$TMPDIR/uncrustify.out" "$1"
  10. # Clean up, deliberately
  11. rm "$TMPDIR/uncrustify.out"
  12. rmdir "$TMPDIR"