From f38b66d105e866ad030cb8a55b5fd28d13434293 Mon Sep 17 00:00:00 2001 From: Ken-ichi Mito Date: Wed, 21 Aug 2013 11:02:55 +0900 Subject: [PATCH] check repository response parameters --- Dev/github/GitHubBackup.pm | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Dev/github/GitHubBackup.pm b/Dev/github/GitHubBackup.pm index 73cf1d4..c202d1a 100644 --- a/Dev/github/GitHubBackup.pm +++ b/Dev/github/GitHubBackup.pm @@ -166,6 +166,22 @@ sub full_name { return (shift)->{repos}{full_name}; } +sub has_downloads { + return (shift)->{repos}{has_downloads}; +} + +sub forks_count { + return (shift)->{repos}{forks_count}; +} + +sub has_wiki { + return (shift)->{repos}{has_wiki}; +} + +sub has_issues { + return (shift)->{repos}{has_issues}; +} + sub directory { my $self = shift; @@ -294,10 +310,10 @@ sub save_issues { sub backup { my $self = shift; - $self->clone_git; - $self->set_forks; - $self->clone_wiki; - $self->save_issues; + $self->clone_git if ($self->has_downloads eq 'true'); + $self->set_forks if ($self->forks_count > 0); + $self->clone_wiki if ($self->has_wiki eq 'true'); + $self->save_issues if ($self->has_issues eq 'true'); return $self; } -- 1.7.9.5