浏览代码

Add check if archive is corrupted

Closes #359
Piotr Kwiecinski 4 年之前
父节点
当前提交
59a1784330
共有 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