download-release 541 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. BUILD=$1
  3. DIR=$2
  4. set -euo pipefail
  5. if [ -z "$DIR" ]; then
  6. echo run with $0 BUILD_NUMBER DIR
  7. exit 2
  8. fi
  9. mkdir -p $DIR
  10. BASE=https://geodns.bitnames.com/builds/$BUILD
  11. files=`curl -sf $BASE/checksums.txt | awk '{print $2}'`
  12. metafiles="checksums.txt metadata.json CHANGELOG.md artifacts.json"
  13. for f in $metafiles; do
  14. url=$BASE/$f
  15. echo downloading $url
  16. curl --remove-on-error -sSfRo $DIR/$f $url || true
  17. done
  18. for f in $files; do
  19. url=$BASE/$f
  20. echo downloading $url
  21. curl --remove-on-error -sSfRo $DIR/$f $url
  22. done