Skip to content

Commit 303656d

Browse files
authored
Require name argument (#178)
1 parent 2485f9a commit 303656d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/NewCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected function configure()
2424
$this
2525
->setName('new')
2626
->setDescription('Create a new Laravel application')
27-
->addArgument('name', InputArgument::OPTIONAL)
27+
->addArgument('name', InputArgument::REQUIRED)
2828
->addOption('dev', null, InputOption::VALUE_NONE, 'Installs the latest "development" release')
2929
->addOption('jet', null, InputOption::VALUE_NONE, 'Installs the Laravel Jetstream scaffolding')
3030
->addOption('stack', null, InputOption::VALUE_OPTIONAL, 'The Jetstream stack that should be installed')
@@ -70,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7070

7171
$name = $input->getArgument('name');
7272

73-
$directory = $name && $name !== '.' ? getcwd().'/'.$name : '.';
73+
$directory = $name !== '.' ? getcwd().'/'.$name : '.';
7474

7575
$version = $this->getVersion($input);
7676

@@ -101,7 +101,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
101101
}
102102

103103
if (($process = $this->runCommands($commands, $input, $output))->isSuccessful()) {
104-
if ($name && $name !== '.') {
104+
if ($name !== '.') {
105105
$this->replaceInFile(
106106
'APP_URL=http://localhost',
107107
'APP_URL=http://'.$name.'.test',

0 commit comments

Comments
 (0)