Skip to content

Commit

Permalink
add prompt-jetstream switch
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Oct 30, 2020
1 parent 3995a7e commit 95c3a00
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ protected function configure()
->addOption('jet', null, InputOption::VALUE_NONE, 'Installs the Laravel Jetstream scaffolding')
->addOption('stack', null, InputOption::VALUE_OPTIONAL, 'The Jetstream stack that should be installed')
->addOption('teams', null, InputOption::VALUE_NONE, 'Indicates whether Jetstream should be scaffolded with team support')
->addOption('prompt-jetstream', null, InputOption::VALUE_NONE, 'Issues a prompt to determine if Jetstream should be installed')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Forces install even if the directory already exists');
}

Expand All @@ -41,7 +42,10 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
if ($input->getOption('jet')) {
$installJetstream = $input->getOption('jet') ||
(new SymfonyStyle($input, $output))->confirm('Would you like to install the Laravel Jetstream application scaffolding?', false);

if ($installJetstream) {
$output->write(PHP_EOL."<fg=magenta>
| | |
|,---.|--- ,---.|--- ,---.,---.,---.,-.-.
Expand Down Expand Up @@ -117,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
);
}

if ($input->getOption('jet')) {
if ($installJetstream) {
$this->installJetstream($directory, $stack, $teams, $input, $output);
}

Expand Down

0 comments on commit 95c3a00

Please sign in to comment.