Enbld/Command/Upgrade.pm untested

filter: Statementstmt 0.0% 0 / 48 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 12 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 63 SCAR 17.9
CC
2
Cov
0%
do
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 6.0
1 package Enbld::Command::Upgrade;
2  
3 use strict;
4 use warnings;
5  
6 use 5.010001;
7  
8 use parent qw/Enbld::Command/;
9  
10 use Try::Lite;
11  
12 require Enbld::App::Configuration;
13 require Enbld::Error;
14 require Enbld::Exception;
15 require Enbld::Message;
16 require Enbld::Target;
17 require Enbld::Feature;
18  
19 sub do {
20 my $self = shift;
21  
22 my $target_name = $self->validate_target_name( shift @{ $self->{argv} } );
23
24 $self->setup;
25
26 my $config = Enbld::App::Configuration->search_config( $target_name );
27 my $target = Enbld::Target->new( $target_name, $config );
28  
29 my $installed = try {
30 return $target->upgrade;
31 } ( 'Enbld::Error' => sub {
32 Enbld::Message->alert( $@ );
33 say "\nPlease check build logile:" . Enbld::Logger->logfile;
34 return;
35 }
36 );
37  
38 if ( $installed ) {
39 Enbld::App::Configuration->set_config( $installed );
40 }
41
42 $self->teardown;
43  
44 return $installed;
45 }
46  
47 1;