From 43ec4eeb0a2f0c9102bbf144dc2a4d68a4a03a7f Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Mon, 13 May 2024 10:48:45 -0400 Subject: [PATCH] fix(shorebird_cli): install release flutter on patch (#2084) --- .../lib/src/commands/patch/patch_command.dart | 8 ++++++++ .../test/src/commands/patch/patch_command_test.dart | 3 +++ 2 files changed, 11 insertions(+) diff --git a/packages/shorebird_cli/lib/src/commands/patch/patch_command.dart b/packages/shorebird_cli/lib/src/commands/patch/patch_command.dart index 3579d6da..be4e25d1 100644 --- a/packages/shorebird_cli/lib/src/commands/patch/patch_command.dart +++ b/packages/shorebird_cli/lib/src/commands/patch/patch_command.dart @@ -16,6 +16,7 @@ import 'package:shorebird_cli/src/patch_diff_checker.dart'; import 'package:shorebird_cli/src/platform/platform.dart'; import 'package:shorebird_cli/src/release_type.dart'; import 'package:shorebird_cli/src/shorebird_env.dart'; +import 'package:shorebird_cli/src/shorebird_flutter.dart'; import 'package:shorebird_cli/src/third_party/flutter_tools/lib/flutter_tools.dart'; import 'package:shorebird_code_push_client/shorebird_code_push_client.dart'; @@ -193,6 +194,13 @@ NOTE: this is ${styleBold.wrap('not')} recommended. Asset changes cannot be incl releaseVersion: releaseVersion, patcher: patcher, ); + + try { + await shorebirdFlutter.installRevision(revision: release.flutterRevision); + } catch (_) { + exit(ExitCode.software.code); + } + final releaseArtifact = await downloadPrimaryReleaseArtifact( release: release, patcher: patcher, diff --git a/packages/shorebird_cli/test/src/commands/patch/patch_command_test.dart b/packages/shorebird_cli/test/src/commands/patch/patch_command_test.dart index 19689765..f7e3f579 100644 --- a/packages/shorebird_cli/test/src/commands/patch/patch_command_test.dart +++ b/packages/shorebird_cli/test/src/commands/patch/patch_command_test.dart @@ -523,6 +523,9 @@ void main() { verifyInOrder([ () => patcher.buildPatchArtifact(), + () => shorebirdFlutter.installRevision( + revision: releaseFlutterRevision, + ), () => shorebirdEnv.copyWith( flutterRevisionOverride: releaseFlutterRevision, ),