diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 38a32326a9d..d3eb8a98296 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -140,29 +140,20 @@ function bake($plugin) { if (strtolower($looksGood) == 'y') { $verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n'); + $skel = dirname(CONSOLE_LIBS) . DS . 'templates' . DS . 'skel'; + $Skel =& new Folder($skel); $Folder =& new Folder($this->path . $pluginPath); - $directories = array( - 'config' . DS . 'sql', - 'models' . DS . 'behaviors', - 'controllers' . DS . 'components', - 'views' . DS . 'helpers', - 'tests' . DS . 'cases' . DS . 'components', - 'tests' . DS . 'cases' . DS . 'helpers', - 'tests' . DS . 'cases' . DS . 'behaviors', - 'tests' . DS . 'cases' . DS . 'controllers', - 'tests' . DS . 'cases' . DS . 'models', - 'tests' . DS . 'groups', - 'tests' . DS . 'fixtures', - 'vendors' . DS . 'img', - 'vendors' . DS . 'js', - 'vendors' . DS . 'css', - 'vendors' . DS . 'shells' - ); - - foreach ($directories as $directory) { - $dirPath = $this->path . $pluginPath . DS . $directory; + $allFiles = $Skel->findRecursive(); + $directories = array(); + foreach($allFiles as $file) { + $dir = ltrim(str_replace($skel, '', dirname($file)), DS); + if (!$dir || preg_match('@^(tmp|plugins)@', $dir) || in_array($dir, $directories)) { + continue; + } + $dirPath = $this->path . $pluginPath . DS . $dir; $Folder->create($dirPath); $File =& new File($dirPath . DS . 'empty', true); + $directories[] = $dir; } if (strtolower($verbose) == 'y') {