Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Constants
- CARD_ID_PREFIX=bc0f047c-01b1-427f-a439-d451eda
- GAME_ID=0f38e453-26df-4c04-9d67-6d43de939c77
- TMPDIR=tmp_builddir
- BASE_URL="http://netrunnerdb.com/web/bundles/netrunnerdbcards/images/cards/en"
- # Positional params
- ZIP_NAME=${1}
- SET_ID=${2}
- shift 2
- CARD_IDS=${*}
- # Derivative vars
- SET_PATH=${GAME_ID}/Sets/${SET_ID}/Cards
- # Prep the build environment
- rm -rf ${TMPDIR}
- mkdir ${TMPDIR}
- cd ${TMPDIR}
- mkdir -p ${SET_PATH}
- # Download and convert the cards
- for CARD in ${CARD_IDS}; do
- wget ${BASE_URL}/${CARD}.png
- convert ${CARD}.png ${SET_PATH}/${CARD_ID_PREFIX}${CARD}.jpg
- done
- # Create the zip archive
- zip -r ANR-${ZIP_NAME} ${GAME_ID}
- # Rename and move zip archive to directory from which we launched
- cd -
- mv ${TMPDIR}/ANR-${ZIP_NAME}.zip ANR-${ZIP_NAME}.o8c
- # Clean up after ourselves
- rm -rf ${TMPDIR}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement