Browse Source

Merge pull request #408 from piotrkwiecinski/allow-fail

allow curl to fail download
Mark Shust 4 years ago
parent
commit
51dc9e2be3
1 changed files with 3 additions and 2 deletions
  1. 3 2
      compose/bin/download

+ 3 - 2
compose/bin/download

@@ -1,5 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 set -o errexit
 set -o errexit
+
 [ -z "$1" ] && echo "Please specify the version to download (ex. 2.0.0)" && exit
 [ -z "$1" ] && echo "Please specify the version to download (ex. 2.0.0)" && exit
 
 
 edition=${2:-community}
 edition=${2:-community}
@@ -12,12 +13,12 @@ fi
 
 
 if [ ! -f ~/.docker-magento/magento2-"$1".tar.gz ]; then
 if [ ! -f ~/.docker-magento/magento2-"$1".tar.gz ]; then
     mkdir -p ~/.docker-magento
     mkdir -p ~/.docker-magento
-    (cd ~/.docker-magento && curl -fOL http://pubfiles.nexcess.net/magento/ce-packages/magento2-"$1".tar.gz)
+    (cd ~/.docker-magento && curl -fOL http://pubfiles.nexcess.net/magento/ce-packages/magento2-"$1".tar.gz) || true
 fi
 fi
 
 
 # Fallback download to hypernode if archive doesn't exist on Nexcess (smaller than 1MB)
 # Fallback download to hypernode if archive doesn't exist on Nexcess (smaller than 1MB)
 if ! tar -tzf  ~/.docker-magento/magento2-"$1".tar.gz -O &>/dev/null; then
 if ! tar -tzf  ~/.docker-magento/magento2-"$1".tar.gz -O &>/dev/null; then
-    (cd ~/.docker-magento && curl -o magento2-"$1".tar.gz -fOL https://www.magento.mirror.hypernode.com/releases/magento-"$1".tar.gz)
+    (cd ~/.docker-magento && curl -o magento2-"$1".tar.gz -fOL https://www.magento.mirror.hypernode.com/releases/magento-"$1".tar.gz) || true
 fi
 fi
 
 
 # Final fallback. If no archive exists, let's use Composer!
 # Final fallback. If no archive exists, let's use Composer!