Skip to content

Commit

Permalink
Catch version mismatch between .horde.yml and changelog.yml.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Schneider committed Jan 14, 2019
1 parent dd66e77 commit 3be3cce
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/Components/Component/Source.php
Expand Up @@ -408,9 +408,17 @@ public function updatePackageFromHordeYml()
// Update date.
$changelog = $this->getFactory()->createChangelog($this);
if ($changelog->changelogFileExists()) {
$changelogYml = $this->getWrapper('ChangelogYml');
if (!isset($changelogYml[$yaml['version']['release']])) {
throw new Components_Exception(sprintf(
'Version %s not found in %s',
$yaml['version']['release'],
$changelogYml->getLocalPath($this->_directory)
));
}
$xml->replaceTextNode(
'/p:package/p:date',
$this->getWrapper('ChangelogYml')[$yaml['version']['release']]['date']
$changelogYml[$yaml['version']['release']]['date']
);
}

Expand Down

0 comments on commit 3be3cce

Please sign in to comment.