update project
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Support\Release\FeatureFlagRegistry;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
final class ReleaseFeatureFlagsCommand extends Command
|
||||
{
|
||||
protected $signature = 'app:release-feature-flags {--format=json}';
|
||||
protected $description = 'Export modular rollout feature flag map.';
|
||||
|
||||
public function handle(FeatureFlagRegistry $registry): int
|
||||
{
|
||||
$data = ['flags' => $registry->export()];
|
||||
$path = storage_path('app/generated/release-feature-flags.json');
|
||||
File::ensureDirectoryExists(dirname($path));
|
||||
File::put($path, json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
||||
|
||||
$this->info('Feature flag rollout map written to '.$path);
|
||||
$this->line(json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user