Skip to content

Commit

Permalink
fix(shorebird_cli): ensure flutter artifacts are installed in `shoreb…
Browse files Browse the repository at this point in the history
…ird preview` (#1812)
  • Loading branch information
bryanoltman authored Mar 22, 2024
1 parent 13de860 commit e159584
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/shorebird_cli/lib/src/commands/preview_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ class PreviewCommand extends ShorebirdCommand {
required DeploymentTrack track,
String? deviceId,
}) async {
await iosDeploy.installIfNeeded();

const platform = ReleasePlatform.ios;
final runnerDirectory = Directory(
getArtifactPath(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,7 @@ channel: ${track.channel}
device: any(named: 'device'),
),
).thenAnswer((_) async => ExitCode.success.code);
when(() => iosDeploy.installIfNeeded()).thenAnswer((_) async {});
when(
() => iosDeploy.installAndLaunchApp(
bundlePath: any(named: 'bundlePath'),
Expand All @@ -1002,6 +1003,11 @@ channel: ${track.channel}
..createSync(recursive: true)
..writeAsStringSync('app_id: $appId', flush: true);

test('ensures ios-deploy is installed', () async {
await runWithOverrides(command.run);
verify(() => iosDeploy.installIfNeeded()).called(1);
});

test('exits with code 70 when querying for release artifact fails',
() async {
final exception = Exception('oops');
Expand Down

0 comments on commit e159584

Please sign in to comment.