uncrustify.sh 369 B

123456789101112131415
  1. #!/usr/bin/env bash
  2. set -eu
  3. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
  4. if ! uncrustify --version >/dev/null; then
  5. echo "you need to install uncrustify for indentation"
  6. exit 1
  7. fi
  8. find "$DIR/../src" \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) \
  9. -exec uncrustify -c "$DIR/uncrustify.cfg" --replace --no-backup {} + \
  10. || true