File tree 3 files changed +20
-5
lines changed 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ Revision history for Github-Backup
7
7
- Added --list, prints to STDOUT the full list of available repository
8
8
objects for the given user
9
9
- Changed github_backup to github-backup
10
+ - We now output information on what repo/issue we're working on
11
+ - Added Hook::Output::Tiny to hide STDERR messages when cloning
10
12
11
13
1.02 2018-02-12
12
14
- fix missing newline backslash in SYNOPSIS
Original file line number Diff line number Diff line change @@ -33,10 +33,11 @@ WriteMakefile(
33
33
' Test::More' => 0,
34
34
},
35
35
PREREQ_PM => {
36
- ' JSON' => 0,
37
- ' LWP::UserAgent' => 6.19,
38
- ' Moo' => 2.003000,
39
- ' Pithub' => 0.01033,
36
+ ' Hook::Output::Tiny' => 0,
37
+ ' JSON' => 0,
38
+ ' LWP::UserAgent' => 6.19,
39
+ ' Moo' => 2.003000,
40
+ ' Pithub' => 0.01033,
40
41
},
41
42
dist => { COMPRESS => ' gzip -9f' , SUFFIX => ' gz' , },
42
43
clean => { FILES => ' Github-Backup-*' },
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use warnings;
6
6
use Carp qw( croak) ;
7
7
use Data::Dumper;
8
8
use Git::Repository;
9
+ use Hook::Output::Tiny;
9
10
use File::Copy;
10
11
use File::Path;
11
12
use JSON;
@@ -113,10 +114,12 @@ sub repos {
113
114
my $repos = $self -> list;
114
115
115
116
for my $repo (@$repos ){
116
- my $stg = $ self-> stg . " / $repo ->{name} " ;
117
+ $ self-> _trap -> hook( ' stderr ' ) ;
117
118
118
119
print " Cloning $repo ->{name}\n " ;
119
120
121
+ my $stg = $self -> stg . " /$repo ->{name}" ;
122
+
120
123
if (! $self -> forks){
121
124
if (! exists $repo -> {parent }){
122
125
Git::Repository-> run(
@@ -131,6 +134,7 @@ sub repos {
131
134
{ quiet => 0 }
132
135
);
133
136
}
137
+ $self -> _trap-> unhook(' stderr' );
134
138
}
135
139
}
136
140
sub issues {
@@ -164,6 +168,14 @@ sub issues {
164
168
}
165
169
}
166
170
}
171
+ sub _trap {
172
+ my ($self ) = @_ ;
173
+ if (! $self -> {trap }) {
174
+ $self -> {trap } = Hook::Output::Tiny-> new;
175
+ }
176
+
177
+ return $self -> {trap };
178
+ }
167
179
sub DESTROY {
168
180
my $self = shift ;
169
181
You can’t perform that action at this time.
0 commit comments