summaryrefslogtreecommitdiff
path: root/data/run-uncrustify.sh
diff options
context:
space:
mode:
authorErnestas Kulik <ernestask@gnome.org>2018-02-14 11:13:04 +0200
committerErnestas Kulik <ernestask@gnome.org>2018-02-14 11:13:04 +0200
commitc64756756910789c8cf4f0523a2fe45e0ac79682 (patch)
treea406f07988f3893d67cb0a32d1fe30f84d733839 /data/run-uncrustify.sh
parent096f8e2d4ffb4d0adac1e87345146a02aa30c7ea (diff)
downloadnautilus-c64756756910789c8cf4f0523a2fe45e0ac79682.tar.gz
run-uncrustify.sh: detect if uncrustify is not installed
Otherwise it will keep spamming stderr about the command not being found.
Diffstat (limited to 'data/run-uncrustify.sh')
-rwxr-xr-xdata/run-uncrustify.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/data/run-uncrustify.sh b/data/run-uncrustify.sh
index c7f1a836b..68caae130 100755
--- a/data/run-uncrustify.sh
+++ b/data/run-uncrustify.sh
@@ -1,5 +1,13 @@
#!/bin/bash
DATA=$(dirname "$BASH_SOURCE")
+UNCRUSTIFY=$(command -v uncrustify)
+
+if [ -z "$UNCRUSTIFY" ];
+then
+ echo "Uncrustify is not installed on your system."
+ exit 1
+fi
+
if [ -x "$DATA/lineup-parameters" ];
then
for DIR in "$DATA/../"{src,test,libnautilus-extension,eel,extensions}
@@ -7,7 +15,7 @@ then
for FILE in $(find "$DIR" -name "*.c")
do
# Aligning prototypes is not working yet, so avoid headers
- uncrustify -c "$DATA/uncrustify.cfg" --no-backup "$FILE"
+ "$UNCRUSTIFY" -c "$DATA/uncrustify.cfg" --no-backup "$FILE"
"$DATA/lineup-parameters" "$FILE" > "$FILE.temp" && mv "$FILE.temp" "$FILE"
done
done