Skip to content

Commit

Permalink
Make missing Proc::InvokeEditor a nonfatal warning and allow ENV over…
Browse files Browse the repository at this point in the history
…ride of editing
  • Loading branch information
ioanrogers committed Jun 11, 2015
1 parent c6d2d7b commit e8b2c02
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Dist/Zilla/Plugin/ChangelogFromGit/CPAN/Changes.pm
Expand Up @@ -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'
);
}
Expand Down

0 comments on commit e8b2c02

Please sign in to comment.