From 92d3845052a65cb3c6d72140c8e100b31feb3531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Thu, 12 Jun 2014 18:22:13 -0300 Subject: [PATCH] Issue #70, makes --release mandatory. --- Mage/Command/BuiltIn/ReleasesCommand.php | 5 +++++ Mage/Command/BuiltIn/RollbackCommand.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Mage/Command/BuiltIn/ReleasesCommand.php b/Mage/Command/BuiltIn/ReleasesCommand.php index f20e052..4d8eded 100644 --- a/Mage/Command/BuiltIn/ReleasesCommand.php +++ b/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('This release is mandatory.', 1, 2); + return false; + } + $subcommand = $this->getConfig()->getArgument(1); $lockFile = '.mage/' . $this->getConfig()->getEnvironment() . '.lock'; if (file_exists($lockFile) && ($subcommand == 'rollback')) { diff --git a/Mage/Command/BuiltIn/RollbackCommand.php b/Mage/Command/BuiltIn/RollbackCommand.php index f852584..1b945ad 100644 --- a/Mage/Command/BuiltIn/RollbackCommand.php +++ b/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('This release is mandatory.', 1, 2); + return false; + } + $lockFile = '.mage/' . $this->getConfig()->getEnvironment() . '.lock'; if (file_exists($lockFile) && ($subcommand == 'rollback')) { Console::output('This environment is locked!', 1, 2);