[nautilus/uncrustify-tweaks: 4/4] run-uncrustify.sh: inverse lineup-parameters check



commit 45fe60560ba98a2197ae0162687e71d5d90aecfd
Author: Ernestas Kulik <ernestask gnome org>
Date:   Wed Feb 14 11:16:38 2018 +0200

    run-uncrustify.sh: inverse lineup-parameters check
    
    Inverting the checks and exiting instead will help keep indentation
    levels in check.

 data/run-uncrustify.sh | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/data/run-uncrustify.sh b/data/run-uncrustify.sh
index 68caae130..722b3fd19 100755
--- a/data/run-uncrustify.sh
+++ b/data/run-uncrustify.sh
@@ -8,18 +8,19 @@ then
     exit 1
 fi
 
-if [ -x "$DATA/lineup-parameters" ];
+if [ ! -x "$DATA/lineup-parameters" ];
 then
-    for DIR in "$DATA/../"{src,test,libnautilus-extension,eel,extensions}
-    do
-        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"
-            "$DATA/lineup-parameters" "$FILE" > "$FILE.temp" && mv "$FILE.temp" "$FILE"
-       done
-    done
-else
     echo "Script lineup-parameters does not exists here in (source directory)/data, probably because 
Nautilus was built in a different directory than the source directory.
 Copy the program in the (build directory)/data/lineup-parameters here in (source directory)/data and run 
again run-uncrustify.sh."
+    exit 1
 fi
+
+for DIR in "$DATA/../"{src,test,libnautilus-extension,eel,extensions}
+do
+    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"
+        "$DATA/lineup-parameters" "$FILE" > "$FILE.temp" && mv "$FILE.temp" "$FILE"
+   done
+done


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]