From e8b2c02f4272c266d905775eec03abf35e979c51 Mon Sep 17 00:00:00 2001 From: Ioan Rogers Date: Wed, 10 Jun 2015 19:39:24 -0700 Subject: [PATCH] Make missing Proc::InvokeEditor a nonfatal warning and allow ENV override of editing --- lib/Dist/Zilla/Plugin/ChangelogFromGit/CPAN/Changes.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Dist/Zilla/Plugin/ChangelogFromGit/CPAN/Changes.pm b/lib/Dist/Zilla/Plugin/ChangelogFromGit/CPAN/Changes.pm index 9fa34ae..c316b40 100644 --- a/lib/Dist/Zilla/Plugin/ChangelogFromGit/CPAN/Changes.pm +++ b/lib/Dist/Zilla/Plugin/ChangelogFromGit/CPAN/Changes.pm @@ -210,14 +210,15 @@ sub gather_files { my $content = $self->_changes->serialize; - # TODO don't bother prompting when only testing - if ($self->edit_changelog) { + $self->log('Editing changelogs is disabled') if $ENV{NO_EDIT_CHANGES}; + + if ($self->edit_changelog && !$ENV{NO_EDIT_CHANGES}) { if (try_load_class('Proc::InvokeEditor')) { my $edited_content = Proc::InvokeEditor->edit($content); my $new_changes = CPAN::Changes->load_string($edited_content); $content = $new_changes->serialize; } else { - $self->logger->log_fatal( + $self->log( 'Proc::InvokeEditor needs to be installed for editing changelogs' ); }