RepoSync/Command/Export.pm untested

filter: Statementstmt 0.0% 0 / 36 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 50 CC 2 SCAR 10.6
CC
2
Cov
0%
run
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.9
1 package App::RepoSync::Command::Export;
2 use 5.10.0;
3 use warnings;
4 use strict;
5 use base qw( CLI::Framework::Command );
6 use Cwd;
7 use YAML;
8 use App::RepoSync::Export;
9  
10 sub run {
11 my ($self,$opts,@args) = @_;
12  
13 my ($export_file,@dirs) = @args;
14  
15 my $cwd = getcwd();
16  
17 $export_file ||= 'repos.yml';
18 @dirs = getcwd() unless @dirs;
19  
20 my @data = ();
21 for( @dirs ) {
22 say "scanning $_";
23 chdir $cwd;
24 my @repos = App::RepoSync::Export->run( $_ );
25 push @data, @repos;
26 }
27  
28 chdir $cwd;
29  
30 say "writing $export_file...";
31 YAML::DumpFile( $export_file , {
32 version => 0.1,
33 repos => \@data,
34 });
35  
36 say "done. @{[ scalar @data ]} repositories exported.";
37 }
38  
39  
40  
41 1;