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