Skip to content

Commit 4178a95

Browse files
committed
Remove the go archive if it is not downloaded correctly
1 parent c0f8539 commit 4178a95

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

script/install-vendored-go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ fi
3939
if ! archiveok; then
4040
echo "Downloading $DOWNLOAD_URL"
4141
mkdir -p "$VENDORDIR"
42-
curl -L -o "$ARCHIVE" $DOWNLOAD_URL
42+
if ! curl -L -o "$ARCHIVE" $DOWNLOAD_URL; then
43+
rm -f "$ARCHIVE"
44+
echo 1>&2 "download failed"
45+
fi
4346
if ! archiveok; then
4447
archivesum 1>&2
45-
echo expected checksum $GO_PKG_SHA 1>&2
48+
echo 1>&2 "expected checksum $GO_PKG_SHA"
4649
exit 1
4750
fi
4851
fi

0 commit comments

Comments
 (0)