print message if crustify is not installed

This commit is contained in:
Florian Dold 2019-08-25 16:12:48 +02:00
parent e59a724ded
commit 3742239c13
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

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