Skip to content

Commit

Permalink
Fix plugin path in shells.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jun 11, 2014
1 parent 3b1bea8 commit 8f88e95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Console/Command/BakeShell.php
Expand Up @@ -108,7 +108,7 @@ public function loadTasks() {
foreach (Plugin::loaded() as $plugin) {
$tasks = $this->_findTasks(
$tasks,
Plugin::path($plugin),
Plugin::path($plugin) . 'src' . DS,
Plugin::getNamespace($plugin),
$plugin
);
Expand Down Expand Up @@ -146,6 +146,7 @@ protected function _findTasks($tasks, $path, $namespace, $prefix = false) {
* Find task classes in a given path.
*
* @param string $path The path to scan.
* @param string $namespace Namespace.
* @return array An array of files that may contain bake tasks.
*/
protected function _findClassFiles($path, $namespace) {
Expand Down Expand Up @@ -188,6 +189,7 @@ protected function _findTaskClasses($files) {
/**
* Quickly bake the MVC
*
* @param string $name Name.
* @return void
*/
public function all($name = null) {
Expand Down
5 changes: 3 additions & 2 deletions src/Console/Command/Task/TestTask.php
Expand Up @@ -81,6 +81,8 @@ class TestTask extends BakeTask {
/**
* Execution method always used for tasks
*
* @param string $type Class type.
* @param string $name Name.
* @return void
*/
public function main($type = null, $name = null) {
Expand Down Expand Up @@ -152,7 +154,7 @@ protected function _getClassOptions($namespace) {
$classes = [];
$base = APP;
if ($this->plugin) {
$base = Plugin::path($this->plugin);
$base = Plugin::path($this->plugin) . 'src' . DS;
}
$path = $base . str_replace('\\', DS, $namespace);
$folder = new Folder($path);
Expand Down Expand Up @@ -432,7 +434,6 @@ public function generateConstructor($type, $fullClassName) {
* Generate the uses() calls for a type & class name
*
* @param string $type The Type of object you are generating tests for eg. controller
* @param string $realType The package name for the class.
* @param string $fullClassName The Classname of the class the test is being generated for.
* @return array An array containing used classes
*/
Expand Down

0 comments on commit 8f88e95

Please sign in to comment.