Skip to content

Commit 735ac1a

Browse files
committed
Made runCommandLine return the status code
1 parent 7341b58 commit 735ac1a

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎packages/pigeon/CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class Foo {
2323
want non-null-safe code you must provide the `--no-dart_null_safety` flag.
2424
* The Pigeon source code is now null-safe.
2525
* Fixed niladic non-value returning async functions in the Java generator.
26+
* Made `runCommandLine` return an the status code.
2627

2728
## 0.1.24
2829

‎packages/pigeon/bin/pigeon.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
import 'package:pigeon/pigeon_cl.dart';
88

99
Future<void> main(List<String> args) async {
10-
await runCommandLine(args);
10+
exit(await runCommandLine(args));
1111
}

‎packages/pigeon/lib/pigeon_cl.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ String _posixRelative(String input, {required String from}) {
2727
/// This is the main entrypoint for the command-line tool. [args] are the
2828
/// commmand line arguments and there is an optional [packageConfig] to
2929
/// accomodate users that want to integrate pigeon with other build systems.
30-
Future<void> runCommandLine(List<String> args, {Uri? packageConfig}) async {
30+
Future<int> runCommandLine(List<String> args, {Uri? packageConfig}) async {
3131
final PigeonOptions opts = Pigeon.parseArgs(args);
3232
final Directory tempDir = Directory.systemTemp.createTempSync(
3333
'flutter_pigeon.',
@@ -71,5 +71,5 @@ void main(List<String> args, SendPort sendPort) async {
7171
});
7272
final int exitCode = await completer.future;
7373
tempDir.deleteSync(recursive: true);
74-
exit(exitCode);
74+
return exitCode;
7575
}

0 commit comments

Comments
 (0)