Skip to content

Commit 42f0d6a

Browse files
authored
Fix latest check logic
Somehow the `if` statement became a single line
1 parent 46e6ce1 commit 42f0d6a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

setup.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ FLUTTER_CHANNEL=${2:-stable}
1010
FLUTTER_OS=$OS
1111

1212
# Detect the latest 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
13+
if [[ $FLUTTER_VERSION == "latest" ]]
14+
then
15+
echo "Detecting latest version..."
16+
curl -L https://storage.googleapis.com/flutter_infra_release/releases/releases_$OS.json -o "${RUNNER_TEMP}/flutter_release.json"
17+
CURRENT_RELEASE=$(jq -r ".current_release.${FLUTTER_CHANNEL}" "${RUNNER_TEMP}/flutter_release.json")
18+
FLUTTER_VERSION=$(jq -r ".releases | map(select(.hash == \"${CURRENT_RELEASE}\")) | .[0].version" "${RUNNER_TEMP}/flutter_release.json")
19+
rm "${RUNNER_TEMP}/flutter_release.json"
1420
fi
1521

1622
# OS archive file extension

0 commit comments

Comments
 (0)