diff --git a/Mage/Command/BuiltIn/CompileCommand.php b/Mage/Command/BuiltIn/CompileCommand.php index f67e875..9cd94b6 100644 --- a/Mage/Command/BuiltIn/CompileCommand.php +++ b/Mage/Command/BuiltIn/CompileCommand.php @@ -28,7 +28,7 @@ class CompileCommand extends AbstractCommand { if (ini_get('phar.readonly')) { Console::output('The php.ini variable phar.readonly must be Off.', 1, 2); - return 300; + return 200; } $compiler = new Compiler; diff --git a/Mage/Command/BuiltIn/DeployCommand.php b/Mage/Command/BuiltIn/DeployCommand.php index bbff2b6..8efa11a 100644 --- a/Mage/Command/BuiltIn/DeployCommand.php +++ b/Mage/Command/BuiltIn/DeployCommand.php @@ -111,20 +111,20 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment */ public function run() { - $exitCode = 1000; + $exitCode = 240; // Check if Environment is not Locked $lockFile = getcwd() . '/.mage/' . $this->getConfig()->getEnvironment() . '.lock'; if (file_exists($lockFile)) { Console::output('This environment is locked!', 1, 2); echo file_get_contents($lockFile); - return 1010; + return 231; } // Check for running instance and Lock if (file_exists(getcwd() . '/.mage/~working.lock')) { Console::output('There is already an instance of Magallanes running!', 1, 2); - return 1020; + return 230; } else { touch(getcwd() . '/.mage/~working.lock'); } diff --git a/Mage/Command/BuiltIn/ListCommand.php b/Mage/Command/BuiltIn/ListCommand.php index 48e89bf..8c3561a 100644 --- a/Mage/Command/BuiltIn/ListCommand.php +++ b/Mage/Command/BuiltIn/ListCommand.php @@ -31,7 +31,7 @@ class ListCommand extends AbstractCommand */ public function run() { - $exitCode = 600; + $exitCode = 221; $subCommand = $this->getConfig()->getArgument(1); try { @@ -56,7 +56,7 @@ class ListCommand extends AbstractCommand */ protected function listEnvironments() { - $exitCode = 600; + $exitCode = 220; $environments = array(); $content = scandir(getcwd() . '/.mage/config/environment/'); foreach ($content as $file) { diff --git a/Mage/Command/BuiltIn/ReleasesCommand.php b/Mage/Command/BuiltIn/ReleasesCommand.php index e9f0443..be8b502 100644 --- a/Mage/Command/BuiltIn/ReleasesCommand.php +++ b/Mage/Command/BuiltIn/ReleasesCommand.php @@ -28,7 +28,7 @@ class ReleasesCommand extends AbstractCommand implements RequiresEnvironment */ public function run() { - $exitCode = 400; + $exitCode = 100; $subCommand = $this->getConfig()->getArgument(1); // Run Tasks for Deployment @@ -40,7 +40,7 @@ class ReleasesCommand extends AbstractCommand implements RequiresEnvironment 1, 3 ); - return 401; + return 101; } $result = true; @@ -67,7 +67,7 @@ class ReleasesCommand extends AbstractCommand implements RequiresEnvironment if (!is_numeric($this->getConfig()->getParameter('release', ''))) { Console::output('Missing required releaseid.', 1, 2); - return 410; + return 102; } $lockFile = getcwd() . '/.mage/' . $this->getConfig()->getEnvironment() . '.lock'; @@ -75,7 +75,7 @@ class ReleasesCommand extends AbstractCommand implements RequiresEnvironment Console::output('This environment is locked!', 1, 2); echo file_get_contents($lockFile); - return 420; + return 103; } $releaseId = $this->getConfig()->getParameter('release', ''); diff --git a/Mage/Command/BuiltIn/RollbackCommand.php b/Mage/Command/BuiltIn/RollbackCommand.php index 1023869..12a8f4e 100644 --- a/Mage/Command/BuiltIn/RollbackCommand.php +++ b/Mage/Command/BuiltIn/RollbackCommand.php @@ -28,19 +28,19 @@ class RollbackCommand extends AbstractCommand implements RequiresEnvironment */ public function run() { - $exitCode = 450; + $exitCode = 105; $releaseId = $this->getConfig()->getArgument(1); if (!is_numeric($releaseId)) { Console::output('This release is mandatory.', 1, 2); - return 451; + return 104; } $lockFile = getcwd() . '/.mage/' . $this->getConfig()->getEnvironment() . '.lock'; if (file_exists($lockFile)) { Console::output('This environment is locked!', 1, 2); echo file_get_contents($lockFile); - return 20; + return 106; } // Run Tasks for Deployment diff --git a/Mage/Command/BuiltIn/UpgradeCommand.php b/Mage/Command/BuiltIn/UpgradeCommand.php index 5de6a2d..7e5aae0 100644 --- a/Mage/Command/BuiltIn/UpgradeCommand.php +++ b/Mage/Command/BuiltIn/UpgradeCommand.php @@ -38,7 +38,7 @@ class UpgradeCommand extends AbstractCommand */ public function run() { - $exitCode = 100; + $exitCode = 99; Console::output('Upgrading Magallanes ... ', 1, 0); $user = ''; diff --git a/bin/mage b/bin/mage index b668d45..b5d201e 100755 --- a/bin/mage +++ b/bin/mage @@ -32,4 +32,4 @@ array_shift($argv); $console = new Mage\Console; $exitCode = $console->run($argv); -exit($exitCode); +exit((integer) $exitCode);