Skip to content

Commit ccd6597

Browse files
committed
feat: Now allowing to select the processes to run through the -p option.
1 parent ef51064 commit ccd6597

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

bin/release.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ import 'package:release/release.dart';
1212
/// - Create a Github release.
1313
Future<void> main(List<String> args) async {
1414
ArgParser parser = ArgParser();
15+
parser.addOption(
16+
'processes',
17+
abbr: 'p',
18+
help: 'Comma separated list of processes to run. If not specified, all processes will be run.'
19+
);
1520
parser.addFlag(
1621
'verbose',
1722
abbr: 'v',
@@ -28,8 +33,15 @@ Future<void> main(List<String> args) async {
2833
stdout.writeln(parser.usage);
2934
return;
3035
}
36+
List<ReleaseProcess> processes = ReleaseProcess.allProcesses;
37+
List<ReleaseProcess>? wantedProcesses = results.option('processes')?.split(',').map(ReleaseProcess.fromId).whereType<ReleaseProcess>().toList();
38+
if (wantedProcesses != null && wantedProcesses.isNotEmpty) {
39+
processes = wantedProcesses;
40+
}
41+
3142
Release release = Release(
3243
verbose: results.flag('verbose'),
44+
processes: processes,
3345
onResult: (process, result) {
3446
if (result is ReleaseProcessResultError) {
3547
stderr.writeln('An error occurred during the execution of the process ${process.runtimeType}.');

0 commit comments

Comments
 (0)