Skip to content

Commit d51b006

Browse files
authored
Merge pull request #56 from statamic/allow-starter-kit-interactivity
2 parents d80204c + 1bb7225 commit d51b006

1 file changed

Lines changed: 28 additions & 5 deletions

File tree

src/NewCommand.php

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
9191
->makeSuperUser()
9292
->notifyIfOldCliVersion()
9393
->showSuccessMessage()
94+
->showPostInstallInstructions()
9495
->askToSpreadJoy();
9596

9697
return 0;
@@ -446,12 +447,14 @@ protected function installStarterKit()
446447
return $this;
447448
}
448449

449-
$options = ['--no-interaction', '--clear-site'];
450+
$options = [
451+
'--cli-install',
452+
'--clear-site',
453+
];
450454

451-
// Temporary option to inform statamic/cms that user is using new CLI Tool installer.
452-
// Since this newer version of the CLI tool will also notify the user of older
453-
// CLI tool versions going forward, so we can rip this option out later.
454-
$options[] = '--cli-install';
455+
if (! $this->input->isInteractive()) {
456+
$options[] = '--no-interaction';
457+
}
455458

456459
if ($this->local) {
457460
$options[] = '--local';
@@ -619,6 +622,26 @@ protected function showSuccessMessage()
619622
return $this;
620623
}
621624

625+
/**
626+
* Show cached post-install instructions, if provided.
627+
*
628+
* @return $this
629+
*/
630+
protected function showPostInstallInstructions()
631+
{
632+
if (! file_exists($instructionsPath = $this->absolutePath.'/storage/statamic/tmp/cli/post-install-instructions.txt')) {
633+
return $this;
634+
}
635+
636+
$this->output->write(PHP_EOL);
637+
638+
foreach (file($instructionsPath) as $line) {
639+
$this->output->write('<comment>'.trim($line).'</comment>'.PHP_EOL);
640+
}
641+
642+
return $this;
643+
}
644+
622645
/**
623646
* Ask if user wants to star our GitHub repo.
624647
*

0 commit comments

Comments
 (0)