From 3742239c13001433eeade439a0e0490f07351c43 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 25 Aug 2019 16:12:48 +0200 Subject: [PATCH] print message if crustify is not installed --- contrib/uncrustify.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/contrib/uncrustify.sh b/contrib/uncrustify.sh index 099741731..e8e05d3e7 100755 --- a/contrib/uncrustify.sh +++ b/contrib/uncrustify.sh @@ -1,3 +1,14 @@ #!/usr/bin/env bash + +set -eu + 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