Commit 09fab8bb authored by Taylor Otwell's avatar Taylor Otwell Committed by GitHub

Merge pull request #63 from jodiedunlop/master

Add --force option to ignore existing directory in new command
parents a000defe d193ad17
...@@ -25,7 +25,8 @@ class NewCommand extends Command ...@@ -25,7 +25,8 @@ class NewCommand extends Command
->setName('new') ->setName('new')
->setDescription('Create a new Laravel application.') ->setDescription('Create a new Laravel application.')
->addArgument('name', InputArgument::OPTIONAL) ->addArgument('name', InputArgument::OPTIONAL)
->addOption('dev', null, InputOption::VALUE_NONE, 'Installs the latest "development" release'); ->addOption('dev', null, InputOption::VALUE_NONE, 'Installs the latest "development" release')
->addOption('force', null, InputOption::VALUE_NONE, 'Forces install even if the directory already exists');
} }
/** /**
...@@ -41,9 +42,11 @@ class NewCommand extends Command ...@@ -41,9 +42,11 @@ class NewCommand extends Command
throw new RuntimeException('The Zip PHP extension is not installed. Please install it and try again.'); throw new RuntimeException('The Zip PHP extension is not installed. Please install it and try again.');
} }
$this->verifyApplicationDoesntExist( $directory = ($input->getArgument('name')) ? getcwd().'/'.$input->getArgument('name') : getcwd();
$directory = ($input->getArgument('name')) ? getcwd().'/'.$input->getArgument('name') : getcwd()
); if (! $input->getOption('force')) {
$this->verifyApplicationDoesntExist($directory);
}
$output->writeln('<info>Crafting application...</info>'); $output->writeln('<info>Crafting application...</info>');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment