if (-d "$dir") {
local $CWD = $dir;
- print "fetch ", $dir, "\n";
+ print "fetch $dir\n";
Git::Repository->run(fetch => '--all');
return $self;
}
- print "clone ", $dir, "\n";
+ print "clone $dir\n";
mkpath $dir;
Git::Repository->run(clone => '--mirror' => $url => $dir);
}
foreach my $fork (@fetch) {
- print "fetch ", $fork, "\n";
+ print "fetch $fork\n";
Git::Repository->run(fetch => $fork);
}
my $dir = $self->directory . '.wiki.git';
my $url = 'https://github.com/' . $self->full_name . '.wiki.git';
+ my $ua = LWP::UserAgent->new(max_redirect => 0);
+ my $res = $ua->head(
+ 'https://github.com/' . $self->full_name . '/wiki'
+ );
+ if ($res->code != 200) {
+ print "$dir does not exist\n";
+ return $self;
+ }
+
$self->sync($url => $dir);
return $self;