Explorar el Código

Merge pull request #328 from piotrkwiecinski/download-script

prevent downloading 404 page content if file doesn't exist
Mark Shust hace 4 años
padre
commit
e944eb7a4d
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  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
 if [ ! -f ~/.docker-magento/magento2-$1.tar.gz ]; then
     mkdir -p ~/.docker-magento
     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
 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 [ $(find ~/.docker-magento/magento2-$1.tar.gz -size -1M) ]; then
 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
 fi
 
 
 # Final fallback. If no archive exists, let's use Composer!
 # 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 "Archive not found, or not yet available due to new version release."
     echo "Attempting install with Composer..."
     echo "Attempting install with Composer..."
     rm -rf src
     rm -rf src