Skip to content

Commit

Permalink
add next version info to release controller
Browse files Browse the repository at this point in the history
  • Loading branch information
cebe committed Mar 17, 2016
1 parent 4112dda commit 70c59c4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build/controllers/ReleaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ public function actionInfo()
}

$versions = $this->getCurrentVersions($extensions);
$nextVersions = $this->getNextVersions($versions, self::PATCH);

// print version table
$w = $this->minWidth(array_keys($versions));
$this->stdout(str_repeat(' ', $w + 2) . "Current Version\n", Console::BOLD);
$this->stdout(str_repeat(' ', $w + 2) . "Current Version Next Version\n", Console::BOLD);
foreach($versions as $ext => $version) {
$this->stdout($ext . str_repeat(' ', $w + 3 - mb_strlen($ext)) . $version . "\n");
$this->stdout($ext . str_repeat(' ', $w + 3 - mb_strlen($ext)) . $version . "");
$this->stdout(str_repeat(' ', 17 - mb_strlen($version)) . $nextVersions[$ext] . "\n");
}

}
Expand Down Expand Up @@ -637,6 +639,10 @@ protected function getCurrentVersions(array $what)
protected function getNextVersions(array $versions, $type)
{
foreach($versions as $k => $v) {
if (empty($v)) {
$versions[$k] = '2.0.0';
continue;
}
$parts = explode('.', $v);
switch($type) {
case self::MINOR:
Expand Down

0 comments on commit 70c59c4

Please sign in to comment.