Skip to content

Commit

Permalink
Throw an error when running static:clear when static caching is dis…
Browse files Browse the repository at this point in the history
…abled
  • Loading branch information
duncanmcclean committed Nov 28, 2024
1 parent aef574f commit 63f52d7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Console/Commands/StaticClear.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ class StaticClear extends Command
*/
public function handle()
{
if (! config('statamic.static_caching.strategy')) {
$this->components->error('Static caching is not enabled.');

return 1;
}

spin(callback: fn () => StaticCache::flush(), message: 'Clearing the static page cache...');

$this->components->info('Your static page cache is now so very, very empty.');
Expand Down

0 comments on commit 63f52d7

Please sign in to comment.