Skip to content

Commit

Permalink
Making project task and bake play nice with creating a new project.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Oct 23, 2010
1 parent 1b5cc91 commit c8b0267
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 3 additions & 2 deletions cake/console/shells/bake.php
Expand Up @@ -59,8 +59,9 @@ public function startup() {
*/
public function main() {
if (!is_dir($this->DbConfig->path)) {
if ($this->Project->execute()) {
$this->DbConfig->path = APP_PATH . DS . 'config' . DS;
$path = $this->Project->execute();
if (!empty($path)) {
$this->DbConfig->path = $path . 'config' . DS;
} else {
return false;
}
Expand Down
7 changes: 2 additions & 5 deletions cake/console/shells/tasks/project.php
Expand Up @@ -59,7 +59,7 @@ public function execute() {

while (!$project) {
$prompt = __("What is the full path for this app including the app directory name?\n Example:");
$default = $this->Dispatch->params['working'] . DS . 'myapp';
$default = APP_PATH . 'myapp';
$project = $this->in($prompt . $default, null, $default);
}

Expand Down Expand Up @@ -124,10 +124,7 @@ public function execute() {
} else {
$this->out(__('Project baked but with <warning>some issues.</warning>.'));
}

$this->Dispatch->params['working'] = $path;
$this->Dispatch->params['app'] = basename($path);
return true;
return $path;
}
}

Expand Down

0 comments on commit c8b0267

Please sign in to comment.