if (my $repository = $self->repository) {
$self->{repos} = [
GitHubBackup::Repository->new({
- __super => $self,
+ directory => sub {$self->directory},
full_name => "$account/$repository",
})
];
foreach my $repos (@repos) {
push @{$self->{repos}},
GitHubBackup::Repository->new({
- __super => $self,
+ directory => sub {$self->directory},
full_name => $repos->{full_name},
clone_url => $repos->{clone_url},
})
use Git::Repository;
use File::chdir;
+
sub new {
my $class = shift;
my $args = shift;
return $class->SUPER::new($args);
}
+sub directory {
+ my $self = shift;
+
+ return $self->{directory}->();
+}
+
sub clone_git {
my $self = shift;
- my $dir = $self->{__super}->directory .'/'. $self->{full_name};
+ my $dir = $self->directory .'/'. $self->{full_name};
if (-d "$dir") {
local $CWD = $dir;
print "fetch ", $self->{full_name}, "\n";