File Coverage

blib/lib/Footprintless/App/Command/deployment/clean.pm
Criterion Covered Total %
statement 24 24 100.0
branch 1 2 50.0
condition n/a
subroutine 8 8 100.0
pod 3 3 100.0
total 36 37 97.3


line stmt bran cond sub pod time code
1 5     5   3818 use strict;
  5         13  
  5         139  
2 5     5   24 use warnings;
  5         8  
  5         254  
3              
4             package Footprintless::App::Command::deployment::clean;
5             $Footprintless::App::Command::deployment::clean::VERSION = '1.29';
6             # ABSTRACT: removes all files managed by the deployment
7             # PODNAME: Footprintless::App::Command::deployment::clean
8              
9 5     5   24 use parent qw(Footprintless::App::Action);
  5         9  
  5         26  
10              
11 5     5   210 use Footprintless::App -ignore;
  5         12  
  5         21  
12 5     5   983 use Log::Any;
  5         10  
  5         18  
13              
14             my $logger = Log::Any->get_logger();
15              
16             sub execute {
17 1     1 1 2 my ( $self, $opts, $args ) = @_;
18              
19 1         5 $logger->info('Performing clean...');
20 1         13 $self->{deployment}->clean();
21              
22 1         76 $logger->info('Done...');
23             }
24              
25             sub usage_desc {
26 1     1 1 5 return "fpl deployment DEPLOYMENT_COORD clean %o";
27             }
28              
29             sub validate_args {
30 1     1 1 3 my ( $self, $opts, $args ) = @_;
31              
32 1         2 eval { $self->{deployment} = $self->{footprintless}->deployment( $self->{coordinate} ); };
  1         6  
33              
34 1 50       6 $self->usage_error("invalid coordinate [$self->{coordinate}]: $@") if ($@);
35             }
36              
37             1;
38              
39             __END__