Permalink
Browse files

bame themes now in correct order: app -> plugin -> default

  • Loading branch information...
1 parent 74ee75b commit 63535586220b206284b63dc948eb86ea7eb85ffe @dereuromark dereuromark committed Apr 24, 2012
View
17 lib/Cake/Console/Command/Task/TemplateTask.php
@@ -55,11 +55,18 @@ public function initialize() {
* Find the paths to all the installed shell themes in the app.
*
* Bake themes are directories not named `skel` inside a `Console/Templates` path.
- *
+ * They are listed in this order: app -> plugin -> default
+ *
* @return array Array of bake themes that are installed.
*/
protected function _findThemes() {
- $paths = array();
+ $paths = App::path('Console');
+
+ $plugins = App::objects('plugin');
+ foreach ($plugins as $plugin) {
+ $paths[] = $this->_pluginPath($plugin) . 'Console' . DS;
+ }
+
$core = current(App::core('Console'));
$separator = DS === '/' ? '/' : '\\\\';
$core = preg_replace('#shells' . $separator . '$#', '', $core);
@@ -69,13 +76,7 @@ protected function _findThemes() {
$contents = $Folder->read();
$themeFolders = $contents[0];
- $plugins = App::objects('plugin');
$paths[] = $core;
- foreach ($plugins as $plugin) {
- $paths[] = $this->_pluginPath($plugin) . 'Console' . DS;
- }
-
- $paths = array_merge($paths, App::path('Console'));
// TEMPORARY TODO remove when all paths are DS terminated
foreach ($paths as $i => $path) {
View
2 lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php
@@ -134,7 +134,7 @@ public function testGenerate() {
$result = $this->Task->generate('classes', 'test_object', array('test' => 'foo'));
$expected = "I got rendered\nfoo";
- $this->assertEquals($expected, $result);
+ $this->assertTextEquals($expected, $result);
}
/**

0 comments on commit 6353558

Please sign in to comment.