Skip to content

Commit

Permalink
Exit with error for unsupported S3 backend
Browse files Browse the repository at this point in the history
The `lychee:generate_thumbs` command does not support the S3 backend.
This commit outputs an error message and exits the tool when the command
is invoked with such a backend, avoiding incorrect behaviour such as
writing images to the filesystem.
  • Loading branch information
kiancross committed Dec 28, 2024
1 parent 2b74431 commit 6d6c7de
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/Console/Commands/ImageProcessing/GenerateThumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Console\Commands\ImageProcessing;

use App\Assets\Features;
use App\Contracts\Exceptions\ExternalLycheeException;
use App\Contracts\Exceptions\LycheeException;
use App\Contracts\Models\SizeVariantFactory;
Expand Down Expand Up @@ -60,6 +61,12 @@ public function handle(): int

return 1;
}

if (Features::active('use-s3')) {
$this->error("This tool does not support S3 file storage.");
return 1;
}

$sizeVariantType = self::SIZE_VARIANTS[$sizeVariantName];

$amount = (int) $this->argument('amount');
Expand Down

0 comments on commit 6d6c7de

Please sign in to comment.