File Coverage

blib/lib/Minilla/Release/RunHooks.pm
Criterion Covered Total %
statement 9 19 47.3
branch 0 6 0.0
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 30 40.0


line stmt bran cond sub pod time code
1             package Minilla::Release::RunHooks;
2 1     1   1013 use strict;
  1         2  
  1         28  
3 1     1   5 use warnings;
  1         12  
  1         28  
4 1     1   5 use utf8;
  1         2  
  1         4  
5              
6             sub run {
7 0     0 0   my ($self, $project, $opts) = @_;
8              
9 0           my $return_value = 0;
10 0           my $commands = $project->config->{release}->{hooks};
11              
12 0 0         if ($commands) {
13 0 0         if (ref $commands ne 'ARRAY') {
14 0           warn "Release hooks must be array";
15 0           exit 1;
16             }
17 0           $return_value = system(join ' && ', @$commands);
18             }
19              
20 0 0         if ($return_value != 0) {
21             # Failure executing command of hooks
22 0           exit 1;
23             }
24             }
25              
26             1;
27