Implement creator studio and upload updates
This commit is contained in:
30
app/Console/Commands/RollbackSitemapReleaseCommand.php
Normal file
30
app/Console/Commands/RollbackSitemapReleaseCommand.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Services\Sitemaps\SitemapPublishService;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
final class RollbackSitemapReleaseCommand extends Command
|
||||
{
|
||||
protected $signature = 'skinbase:sitemaps:rollback {release? : Release id to activate instead of the previous published release}';
|
||||
|
||||
protected $description = 'Rollback sitemap delivery to a previous published release.';
|
||||
|
||||
public function handle(SitemapPublishService $publish): int
|
||||
{
|
||||
try {
|
||||
$manifest = $publish->rollback(($release = $this->argument('release')) !== null ? (string) $release : null);
|
||||
} catch (\Throwable $exception) {
|
||||
$this->error($exception->getMessage());
|
||||
|
||||
return self::FAILURE;
|
||||
}
|
||||
|
||||
$this->info('Rolled back to sitemap release [' . (string) $manifest['release_id'] . '].');
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user