Skip to content

Instantly share code, notes, and snippets.

@jolby
Created January 7, 2026 00:39
Show Gist options
  • Select an option

  • Save jolby/c47a194f97ac0bb638f06d23d5b35bf4 to your computer and use it in GitHub Desktop.

Select an option

Save jolby/c47a194f97ac0bb638f06d23d5b35bf4 to your computer and use it in GitHub Desktop.
Flutter libimpeller downloader
#!/usr/bin/env sh
# set traps so it errors out on any error
set -euo pipefail
# Get the directory where the script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Get the parent directory of the script
PARENT_DIR="$(dirname "$SCRIPT_DIR")"
# Now PARENT_DIR contains the parent directory path
echo "Script is in: $SCRIPT_DIR"
echo "Parent directory is: $PARENT_DIR"
DOWNLOAD_DIR="$PARENT_DIR/downloaded_binaries"
# curl https://storage.googleapis.com/flutter_infra_release/flutter/$FLUTTER_ENGINE_SHA/$PLATFORM_ARCH/impeller_sdk.zip
FLUTTER_GIT_ROOT="/LOCAL/PATH/TO/FLUTTER/"
# 1. cd to flutter git root, checkout stable branch
# and cat <flutter-dir>/bin/internal/engine.version
# cd $FLUTTER_GIT_ROOT
git -C "$FLUTTER_GIT_ROOT" checkout stable
FLUTTER_ENGINE_SHA=$(cat "$FLUTTER_GIT_ROOT"/bin/internal/engine.version)
echo "Using latest stable SHA: $FLUTTER_ENGINE_SHA"
PLATFORM_ARCHES="darwin-arm64 darwin-x64 linux-arm64 linux-x64 windows-x64 windows-arm64"
# FLUTTER_ENGINE_REPO_URL="https://github.com/flutter/engine.git"
BASE_URL="https://storage.googleapis.com/flutter_infra_release/flutter"
# 2. for each platform arch, download the impeller_sdk.zip
for PLATFORM_ARCH in $PLATFORM_ARCHES; do
echo "Downloading impeller_sdk.zip for $PLATFORM_ARCH SHA $FLUTTER_ENGINE_SHA"
echo "URL: $BASE_URL/$FLUTTER_ENGINE_SHA/$PLATFORM_ARCH/impeller_sdk.zip"
download_path="$DOWNLOAD_DIR/impeller_sdk-$PLATFORM_ARCH-$FLUTTER_ENGINE_SHA.zip"
echo "Local download path: $download_path"
curl $BASE_URL/$FLUTTER_ENGINE_SHA/$PLATFORM_ARCH/impeller_sdk.zip -o $download_path
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment