Skip to content

Commit a5c57d3

Browse files
authored
Merge pull request #2092 from DrBu7cher/fix-compatibility-checker-stuck
[patrol_cli] fix(compatibility_checker.dart): it get's stuck when it can't find patrol
2 parents 66cc1c0 + 5208f70 commit a5c57d3

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

packages/patrol_cli/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.6.4
2+
3+
- Fix compatibility_checker getting stuck (#2091).
4+
15
## 2.6.3
26

37
- Fix invalid JSON output of version check command (#2087).
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/// Version of Patrol CLI. Must be kept in sync with pubspec.yaml.
22
/// If you update this, make sure that compatibility-table.mdx is updated (if needed)
3-
const version = '2.6.3';
3+
const version = '2.6.4';

packages/patrol_cli/lib/src/compatibility_checker.dart

+16-13
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,27 @@ class CompatibilityChecker {
5353
)
5454
..disposedBy(scope);
5555

56-
process.listenStdOut((line) async {
57-
if (line.startsWith('- patrol ')) {
58-
packageCompleter.complete(line.split(' ').last);
59-
}
60-
}).disposedBy(scope);
56+
process.listenStdOut(
57+
(line) async {
58+
if (line.startsWith('- patrol ')) {
59+
packageCompleter.complete(line.split(' ').last);
60+
}
61+
},
62+
onDone: () {
63+
if (!packageCompleter.isCompleted) {
64+
throwToolExit(
65+
'Failed to read patrol version. Make sure you have patrol '
66+
'dependency in your pubspec.yaml file',
67+
);
68+
}
69+
},
70+
).disposedBy(scope);
6171
});
6272

6373
packageVersion = await packageCompleter.future;
6474

65-
if (packageVersion == null) {
66-
throwToolExit(
67-
'Failed to read patrol version. Make sure you have patrol '
68-
'dependency in your pubspec.yaml file',
69-
);
70-
}
71-
7275
final cliVersion = Version.parse(constants.version);
73-
final patrolVersion = Version.parse(packageVersion);
76+
final patrolVersion = Version.parse(packageVersion!);
7477

7578
final isCompatible = cliVersion.isCompatibleWith(patrolVersion);
7679

packages/patrol_cli/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: patrol_cli
22
description: >
33
Command-line tool for Patrol, a powerful Flutter-native UI testing framework.
4-
version: 2.6.3 # Must be kept in sync with constants.dart
4+
version: 2.6.4 # Must be kept in sync with constants.dart
55
homepage: https://patrol.leancode.co
66
repository: https://github.com/leancodepl/patrol/tree/master/packages/patrol_cli
77
issue_tracker: https://github.com/leancodepl/patrol/issues?q=is%3Aopen+is%3Aissue+label%3A%22package%3A+patrol_cli%22

0 commit comments

Comments
 (0)