Make App::path('Console') overwrite App::core('Console') for themes

This commit is contained in:
Gordon Pettey (petteyg) 2011-11-18 05:00:45 +00:00
parent de5a4ead25
commit 99e6072fd3

View file

@ -57,7 +57,7 @@ class TemplateTask extends Shell {
* @return array Array of bake themes that are installed.
*/
protected function _findThemes() {
$paths = App::path('Console');
$paths = array();
$core = current(App::core('Console'));
$separator = DS === '/' ? '/' : '\\\\';
$core = preg_replace('#shells' . $separator . '$#', '', $core);
@ -68,10 +68,12 @@ class TemplateTask extends Shell {
$themeFolders = $contents[0];
$plugins = App::objects('plugin');
$paths[] = $core;
foreach ($plugins as $plugin) {
$paths[] = $this->_pluginPath($plugin) . 'Console' . DS;
}
$paths[] = $core;
$paths = array_merge($paths, App::path('Console'));
// TEMPORARY TODO remove when all paths are DS terminated
foreach ($paths as $i => $path) {