From 66471a56670144522b59d9eee94a4a8a4f8ace74 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Fri, 30 Sep 2022 12:39:44 -0400 Subject: [PATCH 1/3] =?UTF-8?q?Always=20pass=20`=E2=80=94cli-install`,=20a?= =?UTF-8?q?s=20we=20now=20use=20it=20to=20suppress=20making=20of=20super?= =?UTF-8?q?=20user=20on=20cms=20end.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/NewCommand.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index 45ded2b..3d3c15c 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -446,12 +446,12 @@ protected function installStarterKit() return $this; } - $options = ['--no-interaction', '--clear-site']; + $options = [ + '--cli-install', + '--no-interaction', + '--clear-site', + ]; - // Temporary option to inform statamic/cms that user is using new CLI Tool installer. - // Since this newer version of the CLI tool will also notify the user of older - // CLI tool versions going forward, so we can rip this option out later. - $options[] = '--cli-install'; if ($this->local) { $options[] = '--local'; From 0ae168def073d53d32279352bf6e0ec9fa89e95b Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Fri, 30 Sep 2022 12:40:39 -0400 Subject: [PATCH 2/3] Allow `starter-kit:install` input/interaction, but still allow user to disable for API scenarios. --- src/NewCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index 3d3c15c..d328bac 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -448,10 +448,12 @@ protected function installStarterKit() $options = [ '--cli-install', - '--no-interaction', '--clear-site', ]; + if (! $this->input->isInteractive()) { + $options[] = '--no-interaction'; + } if ($this->local) { $options[] = '--local'; From 1bb72253033c58d5b9d99da22e68fd12783c5648 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Tue, 4 Oct 2022 18:02:44 -0400 Subject: [PATCH 3/3] Show cached post-install instructions, if provided. --- src/NewCommand.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/NewCommand.php b/src/NewCommand.php index d328bac..b54eed8 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -91,6 +91,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ->makeSuperUser() ->notifyIfOldCliVersion() ->showSuccessMessage() + ->showPostInstallInstructions() ->askToSpreadJoy(); return 0; @@ -621,6 +622,26 @@ protected function showSuccessMessage() return $this; } + /** + * Show cached post-install instructions, if provided. + * + * @return $this + */ + protected function showPostInstallInstructions() + { + if (! file_exists($instructionsPath = $this->absolutePath.'/storage/statamic/tmp/cli/post-install-instructions.txt')) { + return $this; + } + + $this->output->write(PHP_EOL); + + foreach (file($instructionsPath) as $line) { + $this->output->write(''.trim($line).''.PHP_EOL); + } + + return $this; + } + /** * Ask if user wants to star our GitHub repo. *