mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Fixing 'no' option when baking projects. Replying no, will enter
iteractive mode now. Fixes #1721
This commit is contained in:
parent
2b20eb8999
commit
4d76840d44
1 changed files with 26 additions and 23 deletions
|
@ -163,31 +163,34 @@ class ProjectTask extends Shell {
|
||||||
|
|
||||||
$looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y', 'n', 'q'), 'y');
|
$looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y', 'n', 'q'), 'y');
|
||||||
|
|
||||||
if (strtolower($looksGood) == 'y') {
|
switch (strtolower($looksGood)) {
|
||||||
$Folder = new Folder($skel);
|
case 'y':
|
||||||
if (!empty($this->params['empty'])) {
|
$Folder = new Folder($skel);
|
||||||
$skip = array();
|
if (!empty($this->params['empty'])) {
|
||||||
}
|
$skip = array();
|
||||||
|
}
|
||||||
|
|
||||||
if ($Folder->copy(array('to' => $path, 'skip' => $skip))) {
|
if ($Folder->copy(array('to' => $path, 'skip' => $skip))) {
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out(__d('cake_console', '<success>Created:</success> %s in %s', $app, $path));
|
$this->out(__d('cake_console', '<success>Created:</success> %s in %s', $app, $path));
|
||||||
$this->hr();
|
$this->hr();
|
||||||
} else {
|
} else {
|
||||||
$this->err(__d('cake_console', "<error>Could not create</error> '%s' properly.", $app));
|
$this->err(__d('cake_console', "<error>Could not create</error> '%s' properly.", $app));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($Folder->messages() as $message) {
|
||||||
|
$this->out(String::wrap(' * ' . $message), 1, Shell::VERBOSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
case 'n':
|
||||||
|
unset($this->args[0]);
|
||||||
|
$this->execute();
|
||||||
|
return false;
|
||||||
|
case 'q':
|
||||||
|
$this->out(__d('cake_console', '<error>Bake Aborted.</error>'));
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($Folder->messages() as $message) {
|
|
||||||
$this->out(String::wrap(' * ' . $message), 1, Shell::VERBOSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} elseif (strtolower($looksGood) == 'q') {
|
|
||||||
$this->out(__d('cake_console', 'Bake Aborted.'));
|
|
||||||
} else {
|
|
||||||
$this->execute(false);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue