RPGs4_sanity/pull.sh

29 lines
682 B
Bash
Executable File

#!/usr/bin/env bash
test -d pvv && rm -rfv pvv
test -e pvv && {
>&2 echo "'pvv' is not a directory"
exit 1
}
mkdir -p pvv/{cards,styles}
#./api.py get-styles | hjson -c | jq '.[].id' --raw-output |
./api.py get-styles | jq '.[].id' --raw-output |
while read style_id; do
(set -x
./api.py get-style $style_id > pvv/styles/$style_id.html
) &
done
./api.py get-card-groups | jq '.[] | select(has("share")) | .id' --raw-output |
while read group_id; do
./api.py get-card-group $group_id | jq '.[].id' --raw-output |
while read card_id; do
(set -x
./api.py get-card $card_id > pvv/cards/$card_id.xml
) &
done
done
wait