Pārlūkot izejas kodu

Merge pull request #402 from piotrkwiecinski/archive-check

Add check if archive is corrupted
Mark Shust 4 gadi atpakaļ
vecāks
revīzija
cf608d7809
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      compose/bin/download

+ 2 - 2
compose/bin/download

@@ -16,12 +16,12 @@ if [ ! -f ~/.docker-magento/magento2-"$1".tar.gz ]; then
 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 ! 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)
 fi
 fi
 
 
 # Final fallback. If no archive exists, let's use Composer!
 # Final fallback. If no archive exists, let's use Composer!
-if [ ! -f ~/.docker-magento/magento2-"$1".tar.gz ]; then
+if ! tar -tzf  ~/.docker-magento/magento2-"$1".tar.gz -O &>/dev/null; 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