File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,16 +32,17 @@ void main(List<String> arguments) async {
3232 } catch (e) {
3333 stderr.writeln ('Error parsing arguments: $e \n ' );
3434 stderr.writeln (parser.usage);
35- exit (1 );
35+ exitCode = 1 ;
36+ return ;
3637 }
3738
3839 if (results.flag ('help' )) {
3940 stdout.writeln ('RFC Number Assigner - Flutter RFC Repository Tooling\n ' );
4041 stdout.writeln (parser.usage);
41- exit ( 0 ) ;
42+ return ;
4243 }
4344
44- final targetFile = results.option ('target-file' );
45+ final targetFile = results.rest.firstOrNull ?? results. option ('target-file' );
4546 final dryRun = results.flag ('dry-run' );
4647
4748 const fs = LocalFileSystem ();
@@ -68,14 +69,17 @@ void main(List<String> arguments) async {
6869
6970 final githubOutput = Platform .environment['GITHUB_OUTPUT' ];
7071 if (githubOutput != null && githubOutput.isNotEmpty) {
71- await File (githubOutput).writeAsString (
72- 'rfc_id=${result .newRfcId }\n new_path=${result .newPath }\n ' ,
73- mode: FileMode .append,
74- );
72+ await fs
73+ .file (githubOutput)
74+ .writeAsString (
75+ 'rfc_id=${result .newRfcId }\n new_path=${result .newPath }\n ' ,
76+ mode: FileMode .append,
77+ );
7578 }
7679 }
7780 } catch (e) {
7881 stderr.writeln ('Assignment failed: $e ' );
79- exit (1 );
82+ exitCode = 1 ;
83+ return ;
8084 }
8185}
Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ Future<Set<String>> defaultGitList({
4343 if (result.exitCode == 0 ) {
4444 return parseLsTreeOutput (result.stdout);
4545 }
46- _logGitError (result);
4746
4847 final cleanBranch = baseBranch.replaceFirst (
4948 RegExp (r'^(?:remotes\/)?(?:origin|upstream)\/' ),
@@ -61,6 +60,8 @@ Future<Set<String>> defaultGitList({
6160 return parseLsTreeOutput (locResult.stdout);
6261 }
6362 _logGitError (locResult);
63+ } else {
64+ _logGitError (result);
6465 }
6566 } catch (e) {
6667 stderr.writeln ('git ls-tree exception: $e ' );
You can’t perform that action at this time.
0 commit comments