diff options
author | Ernestas Kulik <ernestask@gnome.org> | 2018-02-14 11:13:04 +0200 |
---|---|---|
committer | Ernestas Kulik <ernestask@gnome.org> | 2018-02-14 11:13:04 +0200 |
commit | c64756756910789c8cf4f0523a2fe45e0ac79682 (patch) | |
tree | a406f07988f3893d67cb0a32d1fe30f84d733839 /data/run-uncrustify.sh | |
parent | 096f8e2d4ffb4d0adac1e87345146a02aa30c7ea (diff) | |
download | nautilus-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-x | data/run-uncrustify.sh | 10 |
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 |