From 97ff62acb3839040939f12acde5770558ec99207 Mon Sep 17 00:00:00 2001 From: fmessmer Date: Wed, 17 Jul 2024 14:07:05 +0200 Subject: [PATCH 1/2] add --max-time for curl --- bin/nwjs_install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/nwjs_install b/bin/nwjs_install index ec37648..411c9df 100755 --- a/bin/nwjs_install +++ b/bin/nwjs_install @@ -41,7 +41,7 @@ echo "Downloading nwjs..." set +e if [ "$ARCH" == "arm64" ]; then main_uri="https://github.com/LeonardLaszlo/nw.js-armv7-binaries/releases/download/nw60-arm64_2022-01-08/nw60-arm64_2022-01-08.tar.gz" - curl -sL -o $TEMPFILE $main_uri + curl --max-time 10 -sL -o $TEMPFILE $main_uri status=$? if [ $status -ne 0 ] ; then echo "Failed to download '$main_uri': $status" @@ -53,13 +53,13 @@ if [ "$ARCH" == "arm64" ]; then rm -rf docker else main_uri="https://dl.nwjs.io/$VERSION/nwjs-$VERSION-$OS-$ARCH.tar.gz" - curl -sL -o $TEMPFILE $main_uri + curl --max-time 10 -sL -o $TEMPFILE $main_uri status=$? if [ $status -ne 0 ] ; then echo "Failed to download '$main_uri': $status" echo "Using mirror instead..." mirror_uri="https://npm.taobao.org/mirrors/nwjs/$VERSION/nwjs-$VERSION-$OS-$ARCH.tar.gz" - curl -sL -o $TEMPFILE $mirror_uri + curl --max-time 10 -sL -o $TEMPFILE $mirror_uri status=$? if [ $status -ne 0 ] ; then echo "Failed to download '$mirror_uri': $status" From 5a90c3d8417e6308e9b4fb7d74e3e500153bee66 Mon Sep 17 00:00:00 2001 From: fmessmer Date: Wed, 17 Jul 2024 14:07:34 +0200 Subject: [PATCH 2/2] tmp: use local download as fallback --- bin/nwjs_install | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/nwjs_install b/bin/nwjs_install index 411c9df..645b78a 100755 --- a/bin/nwjs_install +++ b/bin/nwjs_install @@ -63,7 +63,11 @@ else status=$? if [ $status -ne 0 ] ; then echo "Failed to download '$mirror_uri': $status" - exit "$status" + echo "using local download $LOCAL_DOWNLOAD" + echo "$PWD" + #exit "$status" + LOCAL_DOWNLOAD="nwjs-$VERSION-$OS-$ARCH.tar.gz" + cp -f "$LOCAL_DOWNLOAD" $TEMPFILE fi fi fi