#!/bin/sh # Download the CC0 "woodcut napoletane" card set (traced from a 1902 Naples # deck) and rename the files to the card codes the backend uses: # colori/denari-asso.svg -> assets/cards/01D.svg # colori/spade-re.svg -> assets/cards/10S.svg # colori/dorso.svg -> assets/cards/back.svg # # Source: https://github.com/SONDLecT/woodcut-napoletane (CC0 1.0) set -eu BASE="https://raw.githubusercontent.com/SONDLecT/woodcut-napoletane/master/colori" OUT="$(dirname "$0")/assets/cards" mkdir -p "$OUT" fetch() { suit="$1"; rank="$2"; code="$3" if [ ! -s "$OUT/$code.svg" ]; then curl -sfL "$BASE/$suit-$rank.svg" -o "$OUT/$code.svg" fi } for suit in denari coppe spade bastoni; do case "$suit" in denari) letter=D ;; coppe) letter=C ;; spade) letter=S ;; bastoni) letter=B ;; esac fetch "$suit" asso "01$letter" for rank in 02 03 04 05 06 07; do fetch "$suit" "$rank" "$rank$letter" done fetch "$suit" fante "08$letter" fetch "$suit" cavallo "09$letter" fetch "$suit" re "10$letter" done if [ ! -s "$OUT/back.svg" ]; then curl -sfL "$BASE/dorso.svg" -o "$OUT/back.svg" fi echo "cards ready in $OUT"