Skip to content

Commit a062490

Browse files
author
Geoffrey Broadwell
committed
Add clone/checkout of component HEAD from local bare repo; add fetch command to fetch new commits to bare repos; stub build command
1 parent b1d60f5 commit a062490

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

bench

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,42 @@ multi MAIN ('setup') {
4242
my $repo = $component<repo_url>;
4343
my $bare = "$name.git";
4444
run < git clone --bare >, $repo, $bare unless $bare.IO.d;
45+
run < git clone -l >, $bare, $name unless $name.IO.d;
46+
}
47+
48+
say 'Setup complete.';
49+
}
50+
51+
#= Fetch latest commits in each cloned component
52+
multi MAIN ('fetch') {
53+
unless 'components'.IO.d {
54+
say "There is no 'components' tree, and thus there are no repos to fetch.";
55+
say "Please run `$*PROGRAM_NAME setup` instead.";
56+
return;
57+
}
58+
59+
chdir 'components';
60+
my $comp_dir = cwd;
61+
62+
for dir('.').sort -> $component-name {
63+
say "==> $component-name";
64+
my $bare = "$component-name/$component-name.git";
65+
66+
unless $bare.IO.d {
67+
say "No bare repository exists for component $component-name; can't fetch updates.";
68+
next;
69+
}
4570

4671
%*ENV<GIT_DIR> = $bare;
47-
my $tag_list = open 'git tag', :p;
48-
my @tags = $tag_list.lines;
49-
.say for @tags;
72+
run < git fetch >;
5073
}
74+
}
5175

52-
say 'Setup complete.';
76+
multi MAIN ('build') {
77+
# %*ENV<GIT_DIR> = $bare;
78+
# my $tag_list = open 'git tag', :p;
79+
# my @tags = $tag_list.lines;
80+
# .say for @tags;
5381
}
5482

5583
#= Clean up generated files and directories

0 commit comments

Comments
 (0)