Created
February 17, 2017 20:05
-
-
Save zacchiro/db303fac6633da6941d4ab116c5c7517 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cards_dir='./server/game/cards' | |
if [ -z "$1" ] ; then | |
echo "Usage: find-unimplemented THRONESDB_DECK.txt" | |
exit 1 | |
fi | |
deck="$1" | |
shift | |
grep '^[0-9]' "$deck" | cut -c 4- | sed 's/ (.*//' | sort -u | | |
while read card ; do | |
normalized_card=$(echo "$card" | tr '[:upper:]' '[:lower:]' | tr -c -d '[:alnum:]') | |
matches=$(find "${cards_dir}/" -name "${normalized_card}.js" | wc -l) | |
case $matches in | |
0) | |
echo "(maybe) unimplemented card: ${card}" | |
;; | |
1) ;; | |
*) | |
echo "multiple matches for: ${card}" | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment