Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Explain and confirm single-site license for paid kits.
  • Loading branch information
jesseleite committed Feb 28, 2022
commit 77a1c6cd1fe8e1459682d78a4d624944c5ada3c8
32 changes: 29 additions & 3 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ protected function validateStarterKitLicense()
$this->output->write('<comment>This is a paid starter kit. If you haven\'t already, you may purchase a license at:</comment>'.PHP_EOL);
$this->output->write("<comment>{$marketplaceUrl}</comment>".PHP_EOL);

$license = $this->getStarterkitLicense();
$license = $this->getStarterKitLicense();

try {
$response = $request->post(self::OUTPOST_ENDPOINT.'validate', ['json' => [
Expand All @@ -322,7 +322,7 @@ protected function validateStarterKitLicense()

$this->starterKitLicense = $license;

return $this;
return $this->confirmSingleSiteLicense();
}

/**
Expand All @@ -345,6 +345,32 @@ protected function confirmUnlistedKit()
return $this;
}

/**
* Confirm single-site license.
*
* @return $this
*/
protected function confirmSingleSiteLicense()
{
$this->output->write(PHP_EOL);
$this->output->write('<comment>Once successfully installed, this single-site license will be marked as used</comment>'.PHP_EOL);
$this->output->write('<comment>cannot be installed on future Statamic sites. Would you like to continue installation?</comment>');

$helper = $this->getHelper('question');

$questionText = 'I am aware this is a single-site license (yes/no) [<comment>no</comment>]: ';

$question = new ConfirmationQuestion($questionText, false);

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

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

return $this;
}

/**
* Install base project.
*
Expand Down Expand Up @@ -597,7 +623,7 @@ protected function throwConnectionException()
*
* @return string
*/
protected function getStarterkitLicense()
protected function getStarterKitLicense()
{
if ($this->starterKitLicense) {
return $this->starterKitLicense;
Expand Down