Advertisement
Guest User

ANR_build_08c

a guest
Jan 16th, 2014
811
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.85 KB | None | 0 0
  1. #!/bin/bash
  2. # Constants
  3. CARD_ID_PREFIX=bc0f047c-01b1-427f-a439-d451eda
  4. GAME_ID=0f38e453-26df-4c04-9d67-6d43de939c77
  5. TMPDIR=tmp_builddir
  6. BASE_URL="http://netrunnerdb.com/web/bundles/netrunnerdbcards/images/cards/en"
  7.  
  8. # Positional params
  9. ZIP_NAME=${1}
  10. SET_ID=${2}
  11. shift 2
  12. CARD_IDS=${*}
  13.  
  14. # Derivative vars
  15. SET_PATH=${GAME_ID}/Sets/${SET_ID}/Cards
  16.  
  17. # Prep the build environment
  18. rm -rf ${TMPDIR}
  19. mkdir ${TMPDIR}
  20. cd ${TMPDIR}
  21. mkdir -p ${SET_PATH}
  22.  
  23. # Download and convert the cards
  24. for CARD in ${CARD_IDS}; do
  25.     wget ${BASE_URL}/${CARD}.png
  26.     convert ${CARD}.png ${SET_PATH}/${CARD_ID_PREFIX}${CARD}.jpg
  27. done
  28.  
  29. # Create the zip archive
  30. zip -r ANR-${ZIP_NAME} ${GAME_ID}
  31.  
  32. # Rename and move zip archive to directory from which we launched
  33. cd -
  34. mv ${TMPDIR}/ANR-${ZIP_NAME}.zip ANR-${ZIP_NAME}.o8c
  35.  
  36. # Clean up after ourselves
  37. rm -rf ${TMPDIR}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement