[firehose] Set exit code and return instead of calling exit(X) (#341)
diff --git a/pkgs/firehose/CHANGELOG.md b/pkgs/firehose/CHANGELOG.md index ef1ba43..4988a36 100644 --- a/pkgs/firehose/CHANGELOG.md +++ b/pkgs/firehose/CHANGELOG.md
@@ -1,3 +1,5 @@ +## 1.0.0-wip + ## 0.10.2 - Don't check licenses of generated files in PR health workflow.
diff --git a/pkgs/firehose/bin/firehose.dart b/pkgs/firehose/bin/firehose.dart index 82bb7dd..247df00 100644 --- a/pkgs/firehose/bin/firehose.dart +++ b/pkgs/firehose/bin/firehose.dart
@@ -20,7 +20,7 @@ if (argResults[helpFlag] as bool) { _usage(argParser); - exit(0); + return; } final validate = argResults[validateFlag] as bool; @@ -34,7 +34,8 @@ if (!validate && !publish) { _usage(argParser, error: 'Error: one of --validate or --publish must be specified.'); - exit(1); + exitCode = 1; + return; } final github = GithubApi(); @@ -42,7 +43,8 @@ _usage(argParser, error: 'Error: --publish can only be executed from within a GitHub ' 'action.'); - exit(1); + exitCode = 1; + return; } final firehose = Firehose(Directory.current, useFlutter, ignoredPackages); @@ -54,7 +56,8 @@ } } on ArgParserException catch (e) { _usage(argParser, error: e.message); - exit(1); + exitCode = 1; + return; } }
diff --git a/pkgs/firehose/pubspec.yaml b/pkgs/firehose/pubspec.yaml index 3198949..dde1a03 100644 --- a/pkgs/firehose/pubspec.yaml +++ b/pkgs/firehose/pubspec.yaml
@@ -1,6 +1,6 @@ name: firehose description: A tool to automate publishing of Pub packages from GitHub actions. -version: 0.10.2 +version: 1.0.0-wip repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose environment: