From 0f8e8fec4618955f62b496a72d9bc80a6b42e0dd Mon Sep 17 00:00:00 2001 From: Erick Date: Tue, 18 Jun 2024 15:36:50 -0300 Subject: [PATCH] fix: don't do pub upgrade at shorebird executable (#2265) --- bin/shorebird.ps1 | 2 +- third_party/flutter/bin/internal/shared.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/shorebird.ps1 b/bin/shorebird.ps1 index 1dc3464e..7a034d98 100644 --- a/bin/shorebird.ps1 +++ b/bin/shorebird.ps1 @@ -132,7 +132,7 @@ function Update-Shorebird { Update-Flutter Push-Location $shorebirdCliDir - & $dart pub upgrade + & $dart pub get Pop-Location Write-Output "Compiling shorebird..." diff --git a/third_party/flutter/bin/internal/shared.sh b/third_party/flutter/bin/internal/shared.sh index f7235293..6233e7e6 100755 --- a/third_party/flutter/bin/internal/shared.sh +++ b/third_party/flutter/bin/internal/shared.sh @@ -23,18 +23,18 @@ function update_flutter { FLUTTER_STORAGE_BASE_URL=https://download.shorebird.dev $FLUTTER_PATH/bin/flutter --version } -function pub_upgrade_with_retry { +function pub_get_with_retry { local total_tries="10" local remaining_tries=$((total_tries - 1)) while [[ "$remaining_tries" -gt 0 ]]; do - (cd "$SHOREBIRD_CLI_DIR" && $DART_PATH pub upgrade) && break - >&2 echo "Error: Unable to 'pub upgrade' shorebird. Retrying in five seconds... ($remaining_tries tries left)" + (cd "$SHOREBIRD_CLI_DIR" && $DART_PATH pub get) && break + >&2 echo "Error: Unable to 'pub get' shorebird. Retrying in five seconds... ($remaining_tries tries left)" remaining_tries=$((remaining_tries - 1)) sleep 5 done if [[ "$remaining_tries" == 0 ]]; then - >&2 echo "Command 'pub upgrade' still failed after $total_tries tries, giving up." + >&2 echo "Command 'pub get' still failed after $total_tries tries, giving up." return 1 fi return 0 @@ -154,7 +154,7 @@ function upgrade_shorebird () ( fi export PUB_ENVIRONMENT="$PUB_ENVIRONMENT:shorebird_install" - pub_upgrade_with_retry + pub_get_with_retry # Move the old snapshot - we can't just overwrite it as the VM might currently have it # memory mapped (e.g. on shorebird upgrade). For downloading a new dart sdk the folder is moved, @@ -227,4 +227,4 @@ function shared::execute() { exit 1 ;; esac -} \ No newline at end of file +}