summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-08-25 16:12:48 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-08-25 16:13:11 +0200
commit3742239c13001433eeade439a0e0490f07351c43 (patch)
tree7c43248f328a64582892e11be298f0019e1e00a7
parente59a724dedbabb09bc27c72a98d32d08a62ee892 (diff)
downloadexchange-3742239c13001433eeade439a0e0490f07351c43.tar.gz
exchange-3742239c13001433eeade439a0e0490f07351c43.tar.bz2
exchange-3742239c13001433eeade439a0e0490f07351c43.zip
print message if crustify is not installed
-rwxr-xr-xcontrib/uncrustify.sh13
1 files changed, 12 insertions, 1 deletions
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