diff --git a/src/Commands/StaticSiteGenerate.php b/src/Commands/StaticSiteGenerate.php index 054be48..0660f00 100644 --- a/src/Commands/StaticSiteGenerate.php +++ b/src/Commands/StaticSiteGenerate.php @@ -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)) { + $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+).'); } diff --git a/tests/Concerns/RunsGeneratorCommand.php b/tests/Concerns/RunsGeneratorCommand.php index eb7da72..1b12e7c 100644 --- a/tests/Concerns/RunsGeneratorCommand.php +++ b/tests/Concerns/RunsGeneratorCommand.php @@ -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');