Browse Source

Merge pull request #328 from piotrkwiecinski/download-script

prevent downloading 404 page content if file doesn't exist
Mark Shust 4 years ago
parent
commit
e944eb7a4d
1 changed files with 3 additions and 3 deletions
  1. 3 3
      compose/bin/download

+ 3 - 3
compose/bin/download

@@ -11,16 +11,16 @@ fi
 
 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)
+    (cd ~/.docker-magento && curl -fOL 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)
+    (cd ~/.docker-magento && curl -o magento2-$1.tar.gz -fOL https://www.magento.mirror.hypernode.com/releases/magento-$1.tar.gz)
 fi
 
 # Final fallback. If no archive exists, let's use Composer!
-if [ $(find ~/.docker-magento/magento2-$1.tar.gz -size -1M) ]; then
+if [ ! -f ~/.docker-magento/magento2-$1.tar.gz ]; then
     echo "Archive not found, or not yet available due to new version release."
     echo "Attempting install with Composer..."
     rm -rf src