File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -5,22 +5,37 @@ INSTALL_LOCATION=$(eval "echo $ORB_EVAL_INSTALL_LOCATION")
55function install_flutter() {
66 local machine=${1:- " Linux" }
77 local arch=${2:- " amd64" }
8+
89 [[ $machine == " Darwin" ]] && uname=macos || uname=linux
9- [[ $arch == " arm64" ]] && version=" flutter_${uname} _arm64" || version=" flutter_${uname} "
10+ [[ $arch =~ " arm64" ]] && version=" flutter_${uname} _arm64" || version=" flutter_${uname} "
1011 [[ $uname == " linux" ]] && suffix=" tar.xz" || suffix=" zip"
1112
1213 baseurl=" https://storage.googleapis.com/flutter_infra_release/releases/stable"
13-
1414 fullurl=" $baseurl /$uname /${version} _$ORB_VAL_FLUTTER_SDK_VERSION -stable.${suffix} "
1515
1616 curl -o " flutter_sdk.${suffix} " " $fullurl "
17+
18+ mkdir -p $INSTALL_LOCATION
19+
20+ if [ $suffix == " tar.xz" ]; then
21+ tar xf flutter_sdk.tar.xz -C " $INSTALL_LOCATION "
22+ else
23+ unzip -oqq flutter_sdk.zip -d " $INSTALL_LOCATION "
24+ fi
25+
26+ rm -f " flutter_sdk.${suffix} "
1727}
1828
19- install_flutter " $( uname) " " $( uname -a) "
29+
30+ if ! command -v flutter & > /dev/null; then
31+ install_flutter " $( uname) " " $( uname -m) "
32+ else
33+ echo " Previous Flutter installation detected: $( eval command -v flutter) "
34+ exit 0
35+ fi
2036
2137echo " export PATH=$INSTALL_LOCATION /flutter/bin:\$ PATH" >> " $BASH_ENV "
2238
2339# shellcheck source=/dev/null
2440source " $BASH_ENV "
2541which flutter
26-
You can’t perform that action at this time.
0 commit comments