Skip to content

Commit

Permalink
Fixing GH issue SineSwiper#34 - properly add default before_install i…
Browse files Browse the repository at this point in the history
…n all cases
  • Loading branch information
pwr22 committed Mar 27, 2016
1 parent 2b750cd commit 233b6d1
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions lib/Dist/Zilla/Role/TravisYML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,15 @@ sub build_travis_yml {
unless ($is_build_branch) {
# Standard DZIL YAML
unless ($self->support_builddir) {
%travis_yml = (%travis_yml, %{ $travis_code{dzil} });
# Fix for GH issue #34
# First merge common before_install
push @{$travis_yml{before_install}}, @{$travis_code{common}{before_install}};
# Then merge phases for DZIL
for (@phases) {
my $dzil_arr = $travis_code{dzil}{$_};
# Only merge those that exist
push @{$travis_yml{$_}}, @$dzil_arr if $dzil_arr;
}
}
# Dual DZIL+build YAML
else {
Expand Down Expand Up @@ -333,7 +341,15 @@ sub build_travis_yml {
}
# Build branch YAML
elsif ($self->build_branch) {
%travis_yml = (%travis_yml, %{ $travis_code{build} });
# Fix for GH issue #34
# First merge common before_install
push @{$travis_yml{before_install}}, @{$travis_code{common}{before_install}};
# Then merge phases for build
for (@phases) {
my $build_arr = $travis_code{build}{$_};
# Only merge those that exist
push @{$travis_yml{$_}}, @$build_arr if $build_arr;
}
}
else {
return; # no point in staying here...
Expand Down

0 comments on commit 233b6d1

Please sign in to comment.