Created
May 7, 2017 08:10
-
-
Save zacchiro/886695e40441ee2280a40cb1298a9215 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=$(mktemp --tmpdir tmp.throneteki-list-unimplemented.XXXXXXXXXX) | |
trap "rm -f ${cards}" EXIT | |
grep -rhoE "'([0-9]{5})'" server/game/cards/ | sort | grep -rhoE "'([0-9]{5})'" server/game/cards/ | tr -d "'" > "$cards" | |
mongo --quiet throneteki <<EOF | |
var file = cat('$cards') | |
var keywordOnlyCards = ['01070', '01072', '01085', '01091', '01132', '01168'] | |
var bannerCards = ['01198', '01199', '01200', '01201', '01202', '01203', '01204', '01205'] | |
var titleCards = ['01206', '01207', '01208', '01209', '01210', '01211'] | |
var words = file.split('\n').concat(keywordOnlyCards).concat(bannerCards).concat(titleCards) | |
db.cards.find({ code: { \$nin: words }, pack_code: { \$ne: 'VDS' }, text: { \$not: { \$type: 10 }, \$exists: true } }, { _id: 0, code: 1, label: 1, pack_code: 1, type_code: 1 }).sort({ code: 1 }).forEach(function(f){print(tojson(f, '', true));}); | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment