Commit 3b35c0c9 authored by Devon Carew's avatar Devon Carew Committed by GitHub

copy the dart sdk directory when we're upgrading it (#11331)

parent 9d901327
......@@ -17,6 +17,7 @@ set -e
FLUTTER_ROOT="$(dirname "$(dirname "$(dirname "${BASH_SOURCE[0]}")")")"
DART_SDK_PATH="$FLUTTER_ROOT/bin/cache/dart-sdk"
DART_SDK_PATH_OLD="$DART_SDK_PATH.old"
DART_SDK_STAMP_PATH="$FLUTTER_ROOT/bin/cache/dart-sdk.stamp"
DART_SDK_VERSION=`cat "$FLUTTER_ROOT/bin/internal/dart-sdk.version"`
......@@ -48,6 +49,13 @@ if [ ! -f "$DART_SDK_STAMP_PATH" ] || [ "$DART_SDK_VERSION" != `cat "$DART_SDK_S
DART_SDK_URL="https://storage.googleapis.com/dart-archive/channels/$DART_CHANNEL/raw/$DART_SDK_VERSION/sdk/$DART_ZIP_NAME"
# if the sdk path exists, copy it to a temporary location
if [ -d "$DART_SDK_PATH" ]; then
rm -rf "$DART_SDK_PATH_OLD"
mv "$DART_SDK_PATH" "$DART_SDK_PATH_OLD"
fi
# install the new sdk
rm -rf -- "$DART_SDK_PATH"
mkdir -p -- "$DART_SDK_PATH"
DART_SDK_ZIP="$FLUTTER_ROOT/bin/cache/dart-sdk.zip"
......@@ -64,4 +72,9 @@ if [ ! -f "$DART_SDK_STAMP_PATH" ] || [ "$DART_SDK_VERSION" != `cat "$DART_SDK_S
}
rm -f -- "$DART_SDK_ZIP"
echo "$DART_SDK_VERSION" > "$DART_SDK_STAMP_PATH"
# delete any temporary sdk path
if [ -d "$DART_SDK_PATH_OLD" ]; then
rm -rf "$DART_SDK_PATH_OLD"
fi
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment