re-add master channel support

This commit is contained in:
Alif Rachmawadi
2023-03-23 05:52:25 +07:00
parent 1508160852
commit 48cafc2471
3 changed files with 21 additions and 5 deletions

View File

@@ -96,7 +96,11 @@ else
RELEASE_MANIFEST=$(curl --silent --connect-timeout 15 --retry 5 "$MANIFEST_URL")
fi
VERSION_MANIFEST=$(echo "$RELEASE_MANIFEST" | filter_by_channel "$CHANNEL" | filter_by_arch "$ARCH" | filter_by_version "$VERSION")
if [[ "$CHANNEL" == "master" ]]; then
VERSION_MANIFEST="{\"channel\":\"$CHANNEL\",\"version\":\"$CHANNEL\",\"dart_sdk_arch\":\"$ARCH\",\"hash\":\"$CHANNEL\",\"sha256\":\"$CHANNEL\"}"
else
VERSION_MANIFEST=$(echo "$RELEASE_MANIFEST" | filter_by_channel "$CHANNEL" | filter_by_arch "$ARCH" | filter_by_version "$VERSION")
fi
if [[ "$VERSION_MANIFEST" == *null* ]]; then
not_found_error "$CHANNEL" "$VERSION" "$ARCH"
@@ -151,8 +155,12 @@ if [[ "$PRINT_ONLY" == true ]]; then
fi
if [[ ! -x "$CACHE_PATH/bin/flutter" ]]; then
archive_url=$(echo "$VERSION_MANIFEST" | jq -r '.archive')
download_archive "$archive_url" "$CACHE_PATH"
if [[ "$CHANNEL" == "master" ]]; then
git clone -b master https://github.com/flutter/flutter.git "$CACHE_PATH"
else
archive_url=$(echo "$VERSION_MANIFEST" | jq -r '.archive')
download_archive "$archive_url" "$CACHE_PATH"
fi
fi
{