Minilla/Release/RunHooks.pm

filter: Statementstmt 50.0% 10 / 20 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 41.9% 13 / 31 CC 4 SCAR 24.7
CC
4
Cov
38%
run
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 11.9
« Minilla/CLI/Clean.pm ↑ Summary Minilla/CLI/Prepare.pm »
1 package Minilla::Release::RunHooks;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 0 ▶sub run {
Subroutine run: not called CC=4 SCAR=30.0
Pod undocumented
7 0 my ($self, $project, $opts) = @_;
8  
9 0 my $return_value = 0;
10 0 my $commands = $project->config->{release}->{hooks};
11  
12 0 ▶ if ($commands) {
Branch: 1 branch
BranchTrueFalseTotal
if ($commands) 0 0 0
13 0 ▶ if (ref $commands ne 'ARRAY') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $commands ne "ARRAY") 0 0 0
14 0 warn "Release hooks must be array";
15 0 exit 1;
16 }
17 0 $return_value = system(join ' && ', @$commands);
18 }
19  
20 0 ▶ if ($return_value != 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($return_value != 0) 0 0 0
21 # Failure executing command of hooks
22 0 exit 1;
23 }
24 }
25  
26 1 1;
27  
« Minilla/CLI/Clean.pm ↑ Summary Minilla/CLI/Prepare.pm »