Skip to content

Commit

Permalink
Merge pull request #52 from joshuablum/add-little-gem-after-creating-…
Browse files Browse the repository at this point in the history
…new-site

Add question about starring the repo on GitHub
  • Loading branch information
jackmcdade authored Jul 4, 2022
2 parents 48db514 + 6f45506 commit 01f4d1b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,24 @@ protected function showSuccessMessage()

$this->output->writeln("Build something rad!");

if (! $this->input->isInteractive()) {
return $this;
}

$questionText = 'Would you like to spread the joy of Statamic by starring the repo? (yes/no) [<comment>no</comment>]: ';
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion($questionText, false);

$this->output->write(PHP_EOL);

if (! $helper->ask($this->input, $this->output, $question)) {
return $this;
}

if(PHP_OS_FAMILY == 'Darwin') exec('open https://github.com/statamic/cms');
if(PHP_OS_FAMILY == 'Windows') exec('start https://github.com/statamic/cms');
if(PHP_OS_FAMILY == 'Linux') exec('xdg-open https://github.com/statamic/cms');

return $this;
}

Expand Down

0 comments on commit 01f4d1b

Please sign in to comment.