From 96d89302621b4d346484e703db73f5b7c9376bc7 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 4 Mar 2021 15:45:26 +0100 Subject: [PATCH 1/2] Fix gathering options --- src/NewCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index 230a7412..4f3d0433 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -123,7 +123,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ); } - if ($input->hasOption('git') || $input->hasOption('github')) { + if ($input->getOption('git') || $input->getOption('github')) { $this->createRepository($directory, $input, $output); } @@ -131,7 +131,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->installJetstream($directory, $stack, $teams, $input, $output); } - if ($input->hasOption('github')) { + if ($input->getOption('github')) { $this->pushToGitHub($name, $directory, $input, $output); } @@ -226,7 +226,7 @@ protected function createRepository(string $directory, InputInterface $input, Ou */ protected function commitChanges(string $message, string $directory, InputInterface $input, OutputInterface $output) { - if (! $input->hasOption('git') && ! $input->hasOption('github')) { + if (! $input->getOption('git') && ! $input->getOption('github')) { return; } From 355024b50e88846a104fe514fc52d504b4b38bf5 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 4 Mar 2021 21:58:49 +0100 Subject: [PATCH 2/2] Fix option calls --- src/NewCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index 4f3d0433..231b1f8e 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -27,7 +27,7 @@ protected function configure() ->addArgument('name', InputArgument::REQUIRED) ->addOption('dev', null, InputOption::VALUE_NONE, 'Installs the latest "development" release') ->addOption('git', null, InputOption::VALUE_NONE, 'Initialize a Git repository') - ->addOption('github', null, InputOption::VALUE_OPTIONAL, 'Create a new repository on GitHub') + ->addOption('github', null, InputOption::VALUE_OPTIONAL, 'Create a new repository on GitHub', false) ->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') @@ -123,7 +123,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ); } - if ($input->getOption('git') || $input->getOption('github')) { + if ($input->getOption('git') || $input->getOption('github') !== false) { $this->createRepository($directory, $input, $output); } @@ -131,7 +131,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->installJetstream($directory, $stack, $teams, $input, $output); } - if ($input->getOption('github')) { + if ($input->getOption('github') !== false) { $this->pushToGitHub($name, $directory, $input, $output); } @@ -226,7 +226,7 @@ protected function createRepository(string $directory, InputInterface $input, Ou */ protected function commitChanges(string $message, string $directory, InputInterface $input, OutputInterface $output) { - if (! $input->getOption('git') && ! $input->getOption('github')) { + if (! $input->getOption('git') && $input->getOption('github') === false) { return; }