Skip to content

Instantly share code, notes, and snippets.

@zacchiro
Created February 17, 2017 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zacchiro/db303fac6633da6941d4ab116c5c7517 to your computer and use it in GitHub Desktop.
Save zacchiro/db303fac6633da6941d4ab116c5c7517 to your computer and use it in GitHub Desktop.
#!/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