download 696 B

123456789101112131415
  1. #!/bin/bash
  2. [ -z "$1" ] && echo "Please specify the version to download (ex. 2.0.0)" && exit
  3. if [ ! -f ~/.docker-magento/magento2-$1.tar.gz ]; then
  4. mkdir -p ~/.docker-magento
  5. (cd ~/.docker-magento && curl -OL http://pubfiles.nexcess.net/magento/ce-packages/magento2-$1.tar.gz)
  6. fi
  7. # Fallback download to hypernode if archive doesn't exist on Nexcess (smaller than 1MB)
  8. if [ $(find ~/.docker-magento/magento2-$1.tar.gz -size -1M) ]; then
  9. (cd ~/.docker-magento && curl -o magento2-$1.tar.gz -OL https://www.magento.mirror.hypernode.com/releases/magento-$1.tar.gz)
  10. fi
  11. echo "Extracting magento2-$1.tar.gz to ./src"
  12. mkdir -p src && tar xzf ~/.docker-magento/magento2-$1.tar.gz -o -C src