Skip to content

Commit

Permalink
Changing the Plugin task to take the dirs to create from the App skel…
Browse files Browse the repository at this point in the history
…eton
  • Loading branch information
AD7six committed Jul 29, 2009
1 parent 9092b25 commit b7b27e3
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions cake/console/libs/tasks/plugin.php
Expand Up @@ -140,29 +140,20 @@ function bake($plugin) {
if (strtolower($looksGood) == 'y') { if (strtolower($looksGood) == 'y') {
$verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n'); $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); $Folder =& new Folder($this->path . $pluginPath);
$directories = array( $allFiles = $Skel->findRecursive();
'config' . DS . 'sql', $directories = array();
'models' . DS . 'behaviors', foreach($allFiles as $file) {
'controllers' . DS . 'components', $dir = ltrim(str_replace($skel, '', dirname($file)), DS);
'views' . DS . 'helpers', if (!$dir || preg_match('@^(tmp|plugins)@', $dir) || in_array($dir, $directories)) {
'tests' . DS . 'cases' . DS . 'components', continue;
'tests' . DS . 'cases' . DS . 'helpers', }
'tests' . DS . 'cases' . DS . 'behaviors', $dirPath = $this->path . $pluginPath . DS . $dir;
'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;
$Folder->create($dirPath); $Folder->create($dirPath);
$File =& new File($dirPath . DS . 'empty', true); $File =& new File($dirPath . DS . 'empty', true);
$directories[] = $dir;
} }


if (strtolower($verbose) == 'y') { if (strtolower($verbose) == 'y') {
Expand Down

0 comments on commit b7b27e3

Please sign in to comment.