Skip to content

Commit d0a381e

Browse files
detect duplicate pin positions
1 parent 212f266 commit d0a381e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,15 @@ for c in $CONNECTORS; do
6565
if [ $(yq e '.pins.[].pin' "$c" | wc -c) -lt 1 ]; then
6666
if ! handle_warning "$WARNING_NO_PINS" "WARNING: No pins found in definition $c"; then continue; fi
6767
fi
68-
DUPES=$(yq e '.pins.[].pin' "$c" | grep -v "null" | uniq -d | tr -d '\n')
68+
DUPES=$(yq e '.pins.[].pin' "$c" | grep -v "null" | sort | uniq -d | tr -d '\n')
6969
if [ -n "$DUPES" ]; then
7070
if ! handle_warning "$WARNING_DUPE" "WARNING: Duplicate pins in $c: $DUPES"; then continue; fi
7171
fi
72+
POSDUPES=$(yq e '.info.pins.[].pin' "$c" | grep -v "null" | sort | uniq -d | tr -d '\n')
73+
POSDUPES+=$(yq e '.info.image.pins.[].pin' "$c" | grep -v "null" | sort | uniq -d | tr -d '\n')
74+
if [ -n "$POSDUPES" ]; then
75+
if ! handle_warning "$WARNING_DUPE" "WARNING: Duplicate pin positionss in $c: $POSDUPES"; then continue; fi
76+
fi
7277
# Get the directory and title, if they exist
7378
DIRECTORY=$(yq e '.info.directory' "$c")
7479
TITLE=$(yq e '.info.title' "$c")

0 commit comments

Comments
 (0)