diff --git a/packages/shorebird_cli/lib/src/artifact_manager.dart b/packages/shorebird_cli/lib/src/artifact_manager.dart index 191d1822..7bdab5ca 100644 --- a/packages/shorebird_cli/lib/src/artifact_manager.dart +++ b/packages/shorebird_cli/lib/src/artifact_manager.dart @@ -88,7 +88,7 @@ Failed to create diff (exit code ${result.exitCode}). await Isolate.run(() async { final inputStream = InputFileStream(zipFile.path); final archive = ZipDecoder().decodeBuffer(inputStream); - extractArchiveToDisk(archive, outputDirectory.path); + await extractArchiveToDisk(archive, outputDirectory.path); inputStream.closeSync(); }); } diff --git a/packages/shorebird_cli/lib/src/commands/preview_command.dart b/packages/shorebird_cli/lib/src/commands/preview_command.dart index 9b28c83a..30b736a9 100644 --- a/packages/shorebird_cli/lib/src/commands/preview_command.dart +++ b/packages/shorebird_cli/lib/src/commands/preview_command.dart @@ -511,7 +511,7 @@ class PreviewCommand extends ShorebirdCommand { ); } } - encoder.close(); + await encoder.close(); // Replace the existing preview artifact with the updated one. tmpAabFile.copySync(aabFile.path); diff --git a/packages/shorebird_cli/pubspec.lock b/packages/shorebird_cli/pubspec.lock index b860972d..a6d495e7 100644 --- a/packages/shorebird_cli/pubspec.lock +++ b/packages/shorebird_cli/pubspec.lock @@ -20,10 +20,11 @@ packages: archive: dependency: "direct main" description: - name: archive - sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d" - url: "https://pub.dev" - source: hosted + path: "." + ref: "6b5bf69f76164c7dad164555491e18d5be683785" + resolved-ref: "6b5bf69f76164c7dad164555491e18d5be683785" + url: "https://github.com/brendan-duncan/archive" + source: git version: "3.4.10" args: dependency: "direct main" diff --git a/packages/shorebird_cli/pubspec.yaml b/packages/shorebird_cli/pubspec.yaml index 3aff16cf..494dac4a 100644 --- a/packages/shorebird_cli/pubspec.yaml +++ b/packages/shorebird_cli/pubspec.yaml @@ -9,7 +9,16 @@ environment: sdk: ">=3.0.0 <4.0.0" dependencies: - archive: ^3.3.6 + # TODO(felangel): Use a published version on pub once a new release is published (>3.4.10). + # We're using a specific commit because the latest published version (3.4.10) + # does not include a sync close API for ZipFileEncoder. + # https://github.com/brendan-duncan/archive/commit/94bf62410e9a073451bda0d851a07e8b8863bde4 + # This was causing a flaky test on windows when using `shorebird preview` + # https://github.com/shorebirdtech/shorebird/issues/1902 + archive: + git: + url: https://github.com/brendan-duncan/archive + ref: 6b5bf69f76164c7dad164555491e18d5be683785 args: ^2.3.1 barbecue: ^0.5.0 checked_yaml: ^2.0.2