Browse Source

Issue #43 - Exit code should indicate that something failed.

1.0
Andrés Montañez 11 years ago
parent
commit
ae785225fa
  1. 5
      Mage/Console.php
  2. 4
      bin/mage

5
Mage/Console.php

@ -67,6 +67,8 @@ class Console
*/
public function run($arguments)
{
$exitCode = 10;
// Declare a Shutdown Closure
register_shutdown_function(function() {
// Only Unlock if there was an error
@ -120,6 +122,7 @@ class Console
}
}
$command->run();
$exitCode = 0;
} catch (Exception $exception) {
self::output('<red>' . $exception->getMessage() . '</red>', 1, 2);
@ -135,6 +138,8 @@ class Console
// Check if logs need to be deleted
self::checkLogs($config);
return $exitCode;
}
/**

4
bin/mage

@ -26,4 +26,6 @@ array_shift($argv);
// Run Magallanes
$console = new Mage\Console;
$console->run($argv);
$exitCode = $console->run($argv);
exit($exitCode);

Loading…
Cancel
Save