Skip to content

Commit

Permalink
[5.6] Fix --force on GeneratorCommand
Browse files Browse the repository at this point in the history
When the --force option is used the command should generate and override an existing file
  • Loading branch information
shadoWalker89 committed Feb 20, 2018
1 parent bf93ea0 commit 51614aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GeneratorCommand.php
Expand Up @@ -56,7 +56,7 @@ public function handle()
// First we will check to see if the class already exists. If it does, we don't want
// to create the class and overwrite the user's code. So, we will bail out so the
// code is untouched. Otherwise, we will continue generating this class' files.
if ($this->alreadyExists($this->getNameInput())) {
if ((! $this->hasOption('force') || ! $this->option('force')) && $this->alreadyExists($this->getNameInput())) {
$this->error($this->type.' already exists!');

return false;
Expand Down

0 comments on commit 51614aa

Please sign in to comment.