Skip to content

Commit e1604cf

Browse files
authored
Rework "latest" check logic
1 parent 26aa4d6 commit e1604cf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

setup.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ FLUTTER_CHANNEL=${2:-stable}
1010
FLUTTER_OS=$OS
1111

1212
# Detect the latest version
13-
if [[ $FLUTTER_VERSION == latest ]]
14-
then
15-
FLUTTER_VERSION=$(curl -s https://storage.googleapis.com/flutter_infra_release/releases/releases_$OS.json | jq -r ".releases | map(select(.channel == \"${FLUTTER_CHANNEL}\")) | .[0].version")
13+
if [[ $FLUTTER_VERSION == "latest" ]] then echo "Detecting latest version..." curl -L https://storage.googleapis.com/flutter_infra_release/releases/releases_$OS.json -o "${RUNNER_TEMP}/flutter_release.json" CURRENT_RELEASE=$(jq -r ".current_release.${FLUTTER_CHANNEL}" "${RUNNER_TEMP}/flutter_release.json") FLUTTER_VERSION=$(jq -r ".releases | map(select(.hash == \"${CURRENT_RELEASE}\")) | .[0].version" "${RUNNER_TEMP}/flutter_release.json") rm "${RUNNER_TEMP}/flutter_release.json" fi
1614
fi
1715

1816
# OS archive file extension

0 commit comments

Comments
 (0)