Browse Source

Issue #70, makes --release mandatory.

1.0
Andrés Montañez 10 years ago
parent
commit
92d3845052
  1. 5
      Mage/Command/BuiltIn/ReleasesCommand.php
  2. 5
      Mage/Command/BuiltIn/RollbackCommand.php

5
Mage/Command/BuiltIn/ReleasesCommand.php

@ -28,6 +28,11 @@ class ReleasesCommand extends AbstractCommand implements RequiresEnvironment
*/
public function run()
{
if (!is_numeric($this->getConfig()->getParameter('release', ''))) {
Console::output('<red>This release is mandatory.</red>', 1, 2);
return false;
}
$subcommand = $this->getConfig()->getArgument(1);
$lockFile = '.mage/' . $this->getConfig()->getEnvironment() . '.lock';
if (file_exists($lockFile) && ($subcommand == 'rollback')) {

5
Mage/Command/BuiltIn/RollbackCommand.php

@ -29,6 +29,11 @@ class RollbackCommand extends AbstractCommand implements RequiresEnvironment
public function run()
{
$releaseId = $this->getConfig()->getArgument(1);
if (!is_numeric($releaseId)) {
Console::output('<red>This release is mandatory.</red>', 1, 2);
return false;
}
$lockFile = '.mage/' . $this->getConfig()->getEnvironment() . '.lock';
if (file_exists($lockFile) && ($subcommand == 'rollback')) {
Console::output('<red>This environment is locked!</red>', 1, 2);

Loading…
Cancel
Save