Skip to content

Commit 95c3a00

Browse files
committed
add prompt-jetstream switch
1 parent 3995a7e commit 95c3a00

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/NewCommand.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ protected function configure()
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')
3131
->addOption('teams', null, InputOption::VALUE_NONE, 'Indicates whether Jetstream should be scaffolded with team support')
32+
->addOption('prompt-jetstream', null, InputOption::VALUE_NONE, 'Issues a prompt to determine if Jetstream should be installed')
3233
->addOption('force', 'f', InputOption::VALUE_NONE, 'Forces install even if the directory already exists');
3334
}
3435

@@ -41,7 +42,10 @@ protected function configure()
4142
*/
4243
protected function execute(InputInterface $input, OutputInterface $output)
4344
{
44-
if ($input->getOption('jet')) {
45+
$installJetstream = $input->getOption('jet') ||
46+
(new SymfonyStyle($input, $output))->confirm('Would you like to install the Laravel Jetstream application scaffolding?', false);
47+
48+
if ($installJetstream) {
4549
$output->write(PHP_EOL."<fg=magenta>
4650
| | |
4751
|,---.|--- ,---.|--- ,---.,---.,---.,-.-.
@@ -117,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
117121
);
118122
}
119123

120-
if ($input->getOption('jet')) {
124+
if ($installJetstream) {
121125
$this->installJetstream($directory, $stack, $teams, $input, $output);
122126
}
123127

0 commit comments

Comments
 (0)