File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed
Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ [ -z " $1 " ] && echo " error: expects a query to be passed" && exit 1
4+
5+ bash scripts/jq/jq-all-cards.sh \
6+ | jq --arg name " $1 " ' [.[] | select(.name | test($name; "i"))]'
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ query=$( gum input --prompt=" Card name (fuzzy)> " )
4+ [[ -z $query ]] && exit 1
5+
6+ results=$( bash scripts/jq/jq-fuzzy-name.sh " $query " | jq -r ' .[] | "\(.pack_id)@\(.id)"' )
7+
8+ packs_file=$( bash scripts/jq/locate-pack-json.sh)
9+ lang_sub_dir=$( dirname " $packs_file " )
10+ images_dir=" $lang_sub_dir /images"
11+
12+ echo " $results " | fzf --preview=" scripts/jq/card-previewer.sh {} $images_dir " --height 80%
Original file line number Diff line number Diff line change @@ -24,8 +24,11 @@ bash scripts/jq/jq-rarities-per-pack.sh \
2424 uncommon=$( echo " $pack " | jq ' .rarity_counts[] | select(.rarity == "Uncommon") | .count' || echo 0)
2525 common=$( echo " $pack " | jq ' .rarity_counts[] | select(.rarity == "Common") | .count' || echo 0)
2626
27+ all_count=$( echo " $pack " | jq ' [.rarity_counts[].count] | add' )
28+
2729 gold_sum=" ${FG_YELLOW}${secret_rare:- 0} 🌟 ${treasure_rare:- 0}${COL_RESET} "
2830 purple_sum=" ${FG_PURPLE}${super_rare:- 0} ⭐ ${special:- 0}${COL_RESET} "
31+ pack_name=" ${FG_BLUE} $pack_name ${COL_RESET} "
2932
30- echo -e " (${FG_RED} $pack_id ${COL_RESET} ) $gold_sum / $purple_sum ${COL_RESET}${FG_BLUE} $ pack_name${COL_RESET} "
33+ echo -e " (${FG_RED} $pack_id ${COL_RESET} ) $gold_sum / $purple_sum $pack_name => $all_count "
3134done ;
You can’t perform that action at this time.
0 commit comments