소스 검색

Merge pull request #402 from piotrkwiecinski/archive-check

Add check if archive is corrupted
Mark Shust 4 년 전
부모
커밋
cf608d7809
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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