summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2017-02-28 18:00:42 +0100
committerCarlos Soriano <csoriano@gnome.org>2017-03-03 17:06:18 +0100
commita67d17b142ce8f4830d10f4623a8ebda1c0809ed (patch)
tree404605f484e6bac8475538fa3dbfcd66f931f03d /data
parentd3adbdb9701f3be0386aa32d8d0f6294237a15b5 (diff)
downloadnautilus-a67d17b142ce8f4830d10f4623a8ebda1c0809ed.tar.gz
general: Allow running uncrustify from elsewhere
run-uncrustify.sh script uses cwd relative file names, which fails if it is ran from the repository root or other directory. This commit fixes the paths relative to the script. https://bugzilla.gnome.org/show_bug.cgi?id=779408
Diffstat (limited to 'data')
-rwxr-xr-xdata/run-uncrustify.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/data/run-uncrustify.sh b/data/run-uncrustify.sh
index 3114f557d..39bb29006 100755
--- a/data/run-uncrustify.sh
+++ b/data/run-uncrustify.sh
@@ -1,13 +1,14 @@
#!/bin/bash
-if [ -x "lineup-parameters" ];
+DATA=$(dirname "$BASH_SOURCE")
+if [ -x "$DATA/lineup-parameters" ];
then
- for DIR in ../src ../nautilus-desktop ../test ../libnautilus-extension ../eel ../nautilus-sendto-extension
+ for DIR in "$DATA/../"{src,nautilus-desktop,test,libnautilus-extension,eel,nautilus-sendto-extension}
do
- for FILE in $(find $DIR -name "*.c")
+ for FILE in $(find "$DIR" -name "*.c")
do
# Aligning prototypes is not working yet, so avoid headers
- uncrustify -c uncrustify.cfg --no-backup $FILE
- ./lineup-parameters $FILE > $FILE.temp && mv $FILE.temp $FILE
+ uncrustify -c "$DATA/uncrustify.cfg" --no-backup "$FILE"
+ "$DATA/lineup-parameters" "$FILE" > "$FILE.temp" && mv "$FILE.temp" "$FILE"
done
done
else