Skip to content

Commit

Permalink
Fix return code in ShellDispatcher.
Browse files Browse the repository at this point in the history
If a shell returns false the exit code should be non-zero.
  • Loading branch information
markstory committed Aug 22, 2013
1 parent ecb9c71 commit 2fb5cdf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Cake/Console/ShellDispatcher.php
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2fb5cdf

Please sign in to comment.