Skip to content

Commit

Permalink
Merge pull request #56 from statamic/allow-starter-kit-interactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseleite authored Oct 6, 2022
2 parents d80204c + 1bb7225 commit d51b006
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
->makeSuperUser()
->notifyIfOldCliVersion()
->showSuccessMessage()
->showPostInstallInstructions()
->askToSpreadJoy();

return 0;
Expand Down Expand Up @@ -446,12 +447,14 @@ protected function installStarterKit()
return $this;
}

$options = ['--no-interaction', '--clear-site'];
$options = [
'--cli-install',
'--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->input->isInteractive()) {
$options[] = '--no-interaction';
}

if ($this->local) {
$options[] = '--local';
Expand Down Expand Up @@ -619,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('<comment>'.trim($line).'</comment>'.PHP_EOL);
}

return $this;
}

/**
* Ask if user wants to star our GitHub repo.
*
Expand Down

0 comments on commit d51b006

Please sign in to comment.