vscode-extensions: retry if the marketplace API closes the connection unexpected

This commit is contained in:
Sandro Jäckel 2022-02-15 14:48:30 +01:00
parent f0ac4c742b
commit fb7eab6ac8
No known key found for this signature in database
GPG key ID: B1763F8651144063

View file

@ -40,7 +40,7 @@ function get_vsixpkg() {
URL="https://$1.gallery.vsassets.io/_apis/public/gallery/publisher/$1/extension/$2/latest/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage"
# Quietly but delicately curl down the file, blowing up at the first sign of trouble.
curl --silent --show-error --fail -X GET -o "$EXTTMP/$N.zip" "$URL"
curl --silent --show-error --retry 3 --fail -X GET -o "$EXTTMP/$N.zip" "$URL"
# Unpack the file we need to stdout then pull out the version
VER=$(jq -r '.version' <(unzip -qc "$EXTTMP/$N.zip" "extension/package.json"))
# Calculate the SHA