Skip to content

Commit

Permalink
Fatal when copy_to does not parse an expression ( GH #4 )
Browse files Browse the repository at this point in the history
  • Loading branch information
kentfredric committed Oct 3, 2015
1 parent d73920a commit 63d3495
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Release history for Dist-Zilla-Plugin-Prereqs-Soften

{{$NEXT}}
[Bugfix]
- GH: #4
- Lack of validation in copy_to leads to silently dead code paths.

[Dependencies::Stats]
- Dependencies changed since 0.006000, see misc/*.deps* for details
- develop: +5 ↑3 -2 (suggests: ↑2)
Expand Down
7 changes: 5 additions & 2 deletions lib/Dist/Zilla/Plugin/Prereqs/Soften.pm
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ sub _build__copy_to_extras {
my $self = shift;
my $to = [];
for my $copy ( @{ $self->copy_to } ) {
next unless ( my ( $copy_phase, $copy_rel ) = $copy =~ /\A([^.]+)[.](.+)\z/msx );
push @{$to}, { phase => $copy_phase, relation => $copy_rel };
if ( my ( $copy_phase, $copy_rel ) = $copy =~ /\A([^.]+)[.](.+)\z/msx ) {
push @{$to}, { phase => $copy_phase, relation => $copy_rel };
next;
}
return $self->log_fatal(['copy_to contained value not in form: phase.relation, got %s', $copy ]);
}
return $to;
}
Expand Down
1 change: 0 additions & 1 deletion t/06-bad-copy_to.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use Test::More;

use Test::DZil qw(simple_ini);
use Dist::Zilla::Util::Test::KENTNL 1.003002 qw( dztest );
our $TODO = "Bug #4";
my $test = dztest();
my @ini;

Expand Down

0 comments on commit 63d3495

Please sign in to comment.