Selaa lähdekoodia

Merge pull request #402 from piotrkwiecinski/archive-check

Add check if archive is corrupted
Mark Shust 4 vuotta sitten
vanhempi
commit
cf608d7809
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  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
 
 # 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)
 fi
 
 # 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 "Attempting install with Composer..."
     rm -rf src