Skip to content

Commit

Permalink
Merge pull request #2628 from pummra/patch-1
Browse files Browse the repository at this point in the history
Add message to let user know that no controllers were generated.
  • Loading branch information
markstory committed Jan 8, 2014
2 parents b20ca3f + 5605ff4 commit 9bf7513
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Cake/Console/Command/Task/ControllerTask.php
Expand Up @@ -110,6 +110,7 @@ public function all() {
$admin = $this->Project->getPrefix();
}

$controllersCreated = 0;
foreach ($this->__tables as $table) {
$model = $this->_modelName($table);
$controller = $this->_controllerName($model);
Expand All @@ -123,8 +124,13 @@ public function all() {
if ($this->bake($controller, $actions) && $unitTestExists) {
$this->bakeTest($controller);
}
$controllersCreated++;
}
}

if (!$controllersCreated) {
$this->out(__d('cake_console', 'No Controllers were baked, Models need to exist before Controllers can be baked.'));
}
}

/**
Expand Down

0 comments on commit 9bf7513

Please sign in to comment.