Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple license check #143

Merged
merged 5 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions src/Commands/StaticSiteGenerate.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ public function handle()
{
Partyline::bind($this);

if (config('statamic.editions.pro') && ! config('statamic.system.license_key')) {
$this->error('Statamic Pro is enabled but no site license was found.');
$this->warn('Please set a valid Statamic License Key in your .env file.');
$confirmationText = 'By continuing you agree that this build is for testing purposes only. Do you wish to continue?';

if (! $this->option('no-interaction') && ! $this->confirm($confirmationText)) {
jasonvarga marked this conversation as resolved.
Show resolved Hide resolved
$this->line('Static site generation canceled.');

return 0;
}
}

if (! $workers = $this->option('workers')) {
$this->comment('You may be able to speed up site generation significantly by installing spatie/fork and using multiple workers (requires PHP 8+).');
}
Expand Down
2 changes: 2 additions & 0 deletions tests/Concerns/RunsGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ protected function generate($options = [])
{
$this->assertFalse($this->files->exists($this->destination));

$options['--no-interaction'] ??= true;

$this
->artisan('statamic:ssg:generate', $options)
->doesntExpectOutputToContain('pages not generated');
Expand Down