Skip to content

Commit 332f373

Browse files
committed
[scripts] previous_release: improve failed download error message
before: ------------------------------------------------------------ $ contrib/devtools/previous_release.sh -r -b v0.9.5 [...] gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now ------------------------------------------------------------ now: ------------------------------------------------------------ $ contrib/devtools/previous_release.sh -r -b v0.9.5 [...] curl: (22) The requested URL returned error: 404 Not Found Download failed. ------------------------------------------------------------
1 parent 5236b2e commit 332f373

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

contrib/devtools/previous_release.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ pushd "$TARGET" || exit 1
139139
fi
140140
URL="https://bitcoin.org/$BIN_PATH/bitcoin-${tag:1}-$PLATFORM.tar.gz"
141141
echo "Fetching: $URL"
142-
curl -O $URL
142+
if ! curl -O -f $URL; then
143+
echo "Download failed."
144+
exit 1
145+
fi
143146
tar -zxf "bitcoin-${tag:1}-$PLATFORM.tar.gz" -C "$tag" --strip-components=1 "bitcoin-${tag:1}"
144147
rm "bitcoin-${tag:1}-$PLATFORM.tar.gz"
145148
fi

0 commit comments

Comments
 (0)