Skip to content

Commit fe4979b

Browse files
authored
[firehose] Set exit code and return instead of calling exit(X) (#341)
1 parent 5b0d815 commit fe4979b

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

pkgs/firehose/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 1.0.0-wip
2+
13
## 0.10.2
24

35
- Don't check licenses of generated files in PR health workflow.

pkgs/firehose/bin/firehose.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void main(List<String> arguments) async {
2020

2121
if (argResults[helpFlag] as bool) {
2222
_usage(argParser);
23-
exit(0);
23+
return;
2424
}
2525

2626
final validate = argResults[validateFlag] as bool;
@@ -34,15 +34,17 @@ void main(List<String> arguments) async {
3434
if (!validate && !publish) {
3535
_usage(argParser,
3636
error: 'Error: one of --validate or --publish must be specified.');
37-
exit(1);
37+
exitCode = 1;
38+
return;
3839
}
3940

4041
final github = GithubApi();
4142
if (publish && !github.inGithubContext) {
4243
_usage(argParser,
4344
error: 'Error: --publish can only be executed from within a GitHub '
4445
'action.');
45-
exit(1);
46+
exitCode = 1;
47+
return;
4648
}
4749

4850
final firehose = Firehose(Directory.current, useFlutter, ignoredPackages);
@@ -54,7 +56,8 @@ void main(List<String> arguments) async {
5456
}
5557
} on ArgParserException catch (e) {
5658
_usage(argParser, error: e.message);
57-
exit(1);
59+
exitCode = 1;
60+
return;
5861
}
5962
}
6063

pkgs/firehose/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: firehose
22
description: A tool to automate publishing of Pub packages from GitHub actions.
3-
version: 0.10.2
3+
version: 1.0.0-wip
44
repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose
55

66
environment:

0 commit comments

Comments
 (0)