mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
force option for bake tasks (view, model, controller, test, fixture)
This commit is contained in:
parent
e03d3df0fe
commit
0b6919ee94
6 changed files with 16 additions and 1 deletions
|
@ -477,6 +477,9 @@ class ControllerTask extends BakeTask {
|
|||
))->addOption('theme', array(
|
||||
'short' => 't',
|
||||
'help' => __d('cake_console', 'Theme to use when baking code.')
|
||||
))->addOption('force', array(
|
||||
'short' => 'f',
|
||||
'help' => __d('cake_console', 'Force overwriting existing files without prompting.')
|
||||
))->addSubcommand('all', array(
|
||||
'help' => __d('cake_console', 'Bake all controllers with CRUD methods.')
|
||||
))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
|
||||
|
|
|
@ -90,6 +90,9 @@ class FixtureTask extends BakeTask {
|
|||
))->addOption('theme', array(
|
||||
'short' => 't',
|
||||
'help' => __d('cake_console', 'Theme to use when baking code.')
|
||||
))->addOption('force', array(
|
||||
'short' => 'f',
|
||||
'help' => __d('cake_console', 'Force overwriting existing files without prompting.')
|
||||
))->addOption('records', array(
|
||||
'help' => __d('cake_console', 'Used with --count and <name>/all commands to pull [n] records from the live tables, where [n] is either --count or the default of 10.'),
|
||||
'short' => 'r',
|
||||
|
|
|
@ -998,6 +998,9 @@ class ModelTask extends BakeTask {
|
|||
))->addOption('connection', array(
|
||||
'short' => 'c',
|
||||
'help' => __d('cake_console', 'The connection the model table is on.')
|
||||
))->addOption('force', array(
|
||||
'short' => 'f',
|
||||
'help' => __d('cake_console', 'Force overwriting existing files without prompting.')
|
||||
))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
|
||||
}
|
||||
|
||||
|
|
|
@ -569,6 +569,9 @@ class TestTask extends BakeTask {
|
|||
))->addOption('plugin', array(
|
||||
'short' => 'p',
|
||||
'help' => __d('cake_console', 'CamelCased name of the plugin to bake tests for.')
|
||||
))->addOption('force', array(
|
||||
'short' => 'f',
|
||||
'help' => __d('cake_console', 'Force overwriting existing files without prompting.')
|
||||
))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
|
||||
}
|
||||
|
||||
|
|
|
@ -440,6 +440,9 @@ class ViewTask extends BakeTask {
|
|||
))->addOption('connection', array(
|
||||
'short' => 'c',
|
||||
'help' => __d('cake_console', 'The connection the connected model is on.')
|
||||
))->addOption('force', array(
|
||||
'short' => 'f',
|
||||
'help' => __d('cake_console', 'Force overwriting existing files without prompting.')
|
||||
))->addSubcommand('all', array(
|
||||
'help' => __d('cake_console', 'Bake all CRUD action views for all controllers. Requires models and controllers to exist.')
|
||||
))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
|
||||
|
|
|
@ -693,7 +693,7 @@ class Shell extends Object {
|
|||
|
||||
$this->out();
|
||||
|
||||
if (is_file($path) && $this->interactive === true) {
|
||||
if (is_file($path) && empty($this->params['force']) && $this->interactive === true) {
|
||||
$this->out(__d('cake_console', '<warning>File `%s` exists</warning>', $path));
|
||||
$key = $this->in(__d('cake_console', 'Do you want to overwrite?'), array('y', 'n', 'q'), 'n');
|
||||
|
||||
|
|
Loading…
Reference in a new issue