Skip to content

Commit a20cbb6

Browse files
committed
Add list-components command to bench
1 parent cb45086 commit a20cbb6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

bench

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,24 @@ multi MAIN ('extract', *@components) {
172172
}
173173
}
174174

175+
#= List known components with clone status
176+
multi MAIN ('list-components') {
177+
my @names = $COMPONENTS.keys.sort;
178+
my $max-length = max('COMPONENT'.chars, @names>>.chars);
179+
my $format = "%-{$max-length}s %s\n";
180+
printf $format, < COMPONENT STATUS >;
181+
printf $format, < --------- ------ >;
182+
183+
my $missing;
184+
for @names -> $name {
185+
my $bare-dir = "$COMPONENTS_DIR/$name/$name.git";
186+
my $desc = $bare-dir.IO.d ?? 'cloned' !! do { $missing++; '[NOT FOUND]' };
187+
printf $format, $name, $desc;
188+
}
189+
190+
say "\nPlease run `$*PROGRAM_NAME setup` to clone missing components." if $missing;
191+
}
192+
175193
#= List checked out component trees with matching git revision
176194
multi MAIN ('list-checkouts', *@components) {
177195
needs-setup('list');

0 commit comments

Comments
 (0)