Skip to content

Commit

Permalink
detect duplicate pin positions
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckwagoncomputing committed Mar 8, 2024
1 parent 212f266 commit d0a381e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,15 @@ for c in $CONNECTORS; do
if [ $(yq e '.pins.[].pin' "$c" | wc -c) -lt 1 ]; then
if ! handle_warning "$WARNING_NO_PINS" "WARNING: No pins found in definition $c"; then continue; fi
fi
DUPES=$(yq e '.pins.[].pin' "$c" | grep -v "null" | uniq -d | tr -d '\n')
DUPES=$(yq e '.pins.[].pin' "$c" | grep -v "null" | sort | uniq -d | tr -d '\n')
if [ -n "$DUPES" ]; then
if ! handle_warning "$WARNING_DUPE" "WARNING: Duplicate pins in $c: $DUPES"; then continue; fi
fi
POSDUPES=$(yq e '.info.pins.[].pin' "$c" | grep -v "null" | sort | uniq -d | tr -d '\n')
POSDUPES+=$(yq e '.info.image.pins.[].pin' "$c" | grep -v "null" | sort | uniq -d | tr -d '\n')
if [ -n "$POSDUPES" ]; then
if ! handle_warning "$WARNING_DUPE" "WARNING: Duplicate pin positionss in $c: $POSDUPES"; then continue; fi
fi
# Get the directory and title, if they exist
DIRECTORY=$(yq e '.info.directory' "$c")
TITLE=$(yq e '.info.title' "$c")
Expand Down

0 comments on commit d0a381e

Please sign in to comment.