Commit bd06802b authored by Roman Sevastyanov's avatar Roman Sevastyanov

Install into current dir

parent a0a6d8fe
...@@ -24,7 +24,7 @@ class NewCommand extends Command ...@@ -24,7 +24,7 @@ class NewCommand extends Command
$this $this
->setName('new') ->setName('new')
->setDescription('Create a new Laravel application.') ->setDescription('Create a new Laravel application.')
->addArgument('name', InputArgument::REQUIRED) ->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');
} }
...@@ -42,7 +42,7 @@ class NewCommand extends Command ...@@ -42,7 +42,7 @@ class NewCommand extends Command
} }
$this->verifyApplicationDoesntExist( $this->verifyApplicationDoesntExist(
$directory = getcwd().'/'.$input->getArgument('name'), $directory = ($input->getArgument('name')) ? getcwd().'/'.$input->getArgument('name') : getcwd(),
$output $output
); );
...@@ -84,7 +84,7 @@ class NewCommand extends Command ...@@ -84,7 +84,7 @@ class NewCommand extends Command
*/ */
protected function verifyApplicationDoesntExist($directory, OutputInterface $output) protected function verifyApplicationDoesntExist($directory, OutputInterface $output)
{ {
if (is_dir($directory) || is_file($directory)) { if ((is_dir($directory) || is_file($directory)) && $directory != getcwd()) {
throw new RuntimeException('Application already exists!'); throw new RuntimeException('Application already exists!');
} }
} }
......
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