Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion check-style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ case $1 in
esac

# Filter out symlinks from `affected_files`. We'll check the real files.
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
# filenames containing special characters (colons, commas, etc).
filtered_files=""
for f in $affected_files; do
if [ ! -L "$f" ]; then
filtered_files="$filtered_files $f"
fi
done
affected_files=$(echo "$filtered_files" | xargs -r)

# Unset variable would be a sign of programmer error. We are not using '-e' in
# this script as we'd like to handle these cases ourselves where relevant, i.e.,
Expand Down