From 1b9c1bd2a904e0ed9db6935a721d0db2febd239d Mon Sep 17 00:00:00 2001 From: Dan Rubel Date: Thu, 6 Oct 2016 15:32:03 -0400 Subject: [PATCH] improve error message and handling for corrupt dart-sdk download (#6235) --- bin/cache/update_dart_sdk.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/cache/update_dart_sdk.sh b/bin/cache/update_dart_sdk.sh index 7e6fa05217..8cd59cf94a 100755 --- a/bin/cache/update_dart_sdk.sh +++ b/bin/cache/update_dart_sdk.sh @@ -41,7 +41,15 @@ if [ ! -f "$DART_SDK_STAMP_PATH" ] || [ "$DART_SDK_VERSION" != `cat "$DART_SDK_S DART_SDK_ZIP="$FLUTTER_ROOT/bin/cache/dart-sdk.zip" curl --progress-bar -continue-at=- --location --output "$DART_SDK_ZIP" "$DART_SDK_URL" - unzip -o -q "$DART_SDK_ZIP" -d "$FLUTTER_ROOT/bin/cache" + unzip -o -q "$DART_SDK_ZIP" -d "$FLUTTER_ROOT/bin/cache" || { + echo + echo "It appears that the downloaded file is corrupt; please try the operation again later." + echo "If this problem persists, please report the problem at" + echo "https://github.com/flutter/flutter/issues/new" + echo + rm -f -- "$DART_SDK_ZIP" + exit 1 + } rm -f -- "$DART_SDK_ZIP" echo "$DART_SDK_VERSION" > "$DART_SDK_STAMP_PATH" fi