updating project task paths

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5212 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-05-27 16:13:42 +00:00
parent aa81a44bb9
commit b77586db23

View file

@ -51,16 +51,18 @@ class ProjectTask extends Shell {
$working = $this->params['working'];
$app = basename($working);
$root = dirname($working);
$root = dirname($working) . DS;
if($project) {
if($project{0} == '/') {
$app = basename($project);
$root = dirname($project);
} else {
if($project{0} != '/') {
$root = $working;
$app = $project;
}
$path = $root . DS . $app;
if($root{strlen($root) -1} != '/') {
$root = $root . DS;
}
$path = $root . $app;
$response = false;
while ($response == false && is_dir($path) === true && config('database') === true) {
@ -73,13 +75,13 @@ class ProjectTask extends Shell {
}
while (!$project) {
$project = $this->in("What is the full path for this app including the app directory name?\nExample: ".$working . DS . "myapp", null, $working . DS . 'myapp');
$project = $this->in("What is the full path for this app including the app directory name?\nExample: ".$working . "myapp", null, $working . 'myapp');
$this->execute($project);
exit();
}
if (!is_dir($root)) {
$this->err('The directory path you supplied can not be created. Please try again.');
$this->err('The directory path you supplied was not found. Please try again.');
}
$this->__buildDirLayout($path);
@ -113,10 +115,7 @@ class ProjectTask extends Shell {
$app = basename($path);
$this->out('');
$this->out("Skel Directory: $skel");
$this->out("Will be copied to:");
$this->hr();
$this->out("App: $app");
$this->out("Path: $path");
$this->out("Will be copied to: {$path}");
$this->hr();
$looksGood = $this->in('Look okay?', array('y', 'n', 'q'), 'y');