Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GH issue #34 - properly add default before_install in all cases #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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