From 95c3a00ee7fc188121ae3e90292f712eae19b26b Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 30 Oct 2020 16:56:17 -0500 Subject: [PATCH] add prompt-jetstream switch --- src/NewCommand.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index c247173..cb888ce 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -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'); } @@ -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." | | | |,---.|--- ,---.|--- ,---.,---.,---.,-.-. @@ -117,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ); } - if ($input->getOption('jet')) { + if ($installJetstream) { $this->installJetstream($directory, $stack, $teams, $input, $output); }