Skip to content
Permalink
Browse files

Fix return code in ShellDispatcher.

If a shell returns false the exit code should be non-zero.
  • Loading branch information...
markstory committed Aug 21, 2013
1 parent ecb9c71 commit 2fb5cdfbce1e2d6aa97406bd74e384982871111c
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/Cake/Console/ShellDispatcher.php
@@ -125,9 +125,7 @@ protected function _bootstrap() {
* @return integer The cli command exit code. 0 is success.
*/
public function dispatch() {
$exit = 0;
$this->_dispatch();
return $exit;
return $this->_dispatch() === true ? 0 : 1;
}
/**
@@ -160,6 +158,7 @@ protected function _dispatch() {
$Shell->loadTasks();
return $Shell->runCommand($command, $this->args);
}
$methods = array_diff(get_class_methods($Shell), get_class_methods('Cake\Console\Shell'));
$added = in_array($command, $methods);
$private = $command[0] === '_' && method_exists($Shell, $command);

0 comments on commit 2fb5cdf

Please sign in to comment.
You can’t perform that action at this time.