浏览代码

allow curl to fail download

closes #407
Piotr Kwiecinski 4 年之前
父节点
当前提交
eb30383c05
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      compose/bin/download

+ 4 - 2
compose/bin/download

@@ -1,5 +1,7 @@
 #!/bin/bash
 set -o errexit
+set -o xtrace
+
 [ -z "$1" ] && echo "Please specify the version to download (ex. 2.0.0)" && exit
 
 edition=${2:-community}
@@ -12,12 +14,12 @@ fi
 
 if [ ! -f ~/.docker-magento/magento2-"$1".tar.gz ]; then
     mkdir -p ~/.docker-magento
-    (cd ~/.docker-magento && curl -fOL 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 || true)
 fi
 
 # Fallback download to hypernode if archive doesn't exist on Nexcess (smaller than 1MB)
 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 || true)
 fi
 
 # Final fallback. If no archive exists, let's use Composer!