From 3d2f98498f7e0b4f35a703765093d33c2f367b9a Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 30 Jan 2019 12:53:23 -0800 Subject: [PATCH] handle missing curl (#27295) --- bin/internal/update_dart_sdk.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bin/internal/update_dart_sdk.sh b/bin/internal/update_dart_sdk.sh index bc35d77a87..a53eb70597 100755 --- a/bin/internal/update_dart_sdk.sh +++ b/bin/internal/update_dart_sdk.sh @@ -22,6 +22,23 @@ ENGINE_STAMP="$FLUTTER_ROOT/bin/cache/engine-dart-sdk.stamp" ENGINE_VERSION=`cat "$FLUTTER_ROOT/bin/internal/engine.version"` if [ ! -f "$ENGINE_STAMP" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP"` ]; then + command -v curl > /dev/null 2>&1 || { + echo + echo 'Missing "curl" tool. Unable to download Dart SDK.' + case "$(uname -s)" in + Darwin) + echo 'Consider running "brew install curl".' + ;; + Linux) + echo 'Consider running "sudo apt-get install curl".' + ;; + *) + echo "Please install curl." + ;; + esac + echo + exit 1 + } echo "Downloading Dart SDK from Flutter engine $ENGINE_VERSION..." case "$(uname -s)" in