Browse Source

prevent downloading 404 page content if file doesn't exist

Piotr Kwiecinski 4 năm trước cách đây
mục cha
commit
8a8cc3b9a8
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      compose/bin/download

+ 3 - 3
compose/bin/download

@@ -3,16 +3,16 @@
 
 
 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