We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aededce commit 50fd6d1Copy full SHA for 50fd6d1
1 file changed
check-style.sh
@@ -42,7 +42,15 @@ case $1 in
42
esac
43
44
# Filter out symlinks from `affected_files`. We'll check the real files.
45
-affected_files=$(echo "$affected_files" | xargs -r -n1 file | grep -v 'symbolic link' | cut -d: -f1 | tr '\n' ' ')
+# Use bash test operators instead of the 'file' command to avoid issues with
46
+# filenames containing special characters (colons, commas, etc).
47
+filtered_files=""
48
+for f in $affected_files; do
49
+ if [ ! -L "$f" ]; then
50
+ filtered_files="$filtered_files $f"
51
+ fi
52
+done
53
+affected_files=$(echo "$filtered_files" | xargs -r)
54
55
# Unset variable would be a sign of programmer error. We are not using '-e' in
56
# this script as we'd like to handle these cases ourselves where relevant, i.e.,
0 commit comments