angular-docs-cn/scripts/ci/install_dart.sh

31 lines
828 B
Bash
Raw Normal View History

2014-09-29 17:20:23 -04:00
#!/bin/bash
2015-02-13 17:59:29 -05:00
set -e -x
2014-09-29 17:20:23 -04:00
2015-02-13 17:59:29 -05:00
DART_CHANNEL=$1
ARCH=$2
AVAILABLE_DART_VERSION=$(curl "https://storage.googleapis.com/dart-archive/channels/${DART_CHANNEL}/release/latest/VERSION" | python -c \
2014-09-29 17:20:23 -04:00
'import sys, json; print(json.loads(sys.stdin.read())["version"])')
2015-02-13 17:59:29 -05:00
echo Fetch Dart channel: ${DART_CHANNEL}
2014-09-29 17:20:23 -04:00
2015-02-13 17:59:29 -05:00
URL_PREFIX=https://storage.googleapis.com/dart-archive/channels/${DART_CHANNEL}/release/latest
DART_SDK_URL="$URL_PREFIX/sdk/dartsdk-$ARCH-release.zip"
DARTIUM_URL="$URL_PREFIX/dartium/dartium-$ARCH-release.zip"
2014-09-29 17:20:23 -04:00
download_and_unzip() {
ZIPFILE=${1/*\//}
curl -O -L $1 && unzip -q $ZIPFILE && rm $ZIPFILE
}
# TODO: do these downloads in parallel
download_and_unzip $DART_SDK_URL
download_and_unzip $DARTIUM_URL
echo Fetched new dart version $(<dart-sdk/version)
if [[ -n $DARTIUM_URL ]]; then
mv dartium-* chromium
fi