Skip to content

Commit

Permalink
Fix with empty release notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Oct 25, 2017
1 parent b130085 commit 349772e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/Components/Helper/ChangeLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ public function migrateToChangelogYml($xml)
'p:version/p:release', $release
);
$license = $xml->findNodeRelativeTo('p:license', $release);
$notes = trim(preg_replace(
'/^\* /m',
'',
$xml->getNodeTextRelativeTo('p:notes', $release)
));
if ($notes) {
$notes .= "\n";
}
$changes[$version] = array(
'api' => $xml->getNodeTextRelativeTo(
'p:version/p:api', $release
Expand All @@ -176,11 +184,7 @@ public function migrateToChangelogYml($xml)
'identifier' => $license->textContent,
'uri' => $license->getAttribute('uri')
),
'notes' => preg_replace(
'/^\* /m',
'',
trim($xml->getNodeTextRelativeTo('p:notes', $release))
) . "\n"
'notes' => $notes,
);
}
$changes = array_reverse($changes);
Expand Down

0 comments on commit 349772e

Please sign in to comment.