22 lines
722 B
PHP
22 lines
722 B
PHP
<?php
|
|
|
|
namespace Modules\Developer\Console\Commands;
|
|
|
|
use Illuminate\Console\Command;
|
|
use Modules\Developer\Support\ThemeGenerator;
|
|
use Throwable;
|
|
|
|
final class MakeThemeCommand extends Command
|
|
{
|
|
protected $signature = 'theme:make {name} {--force}';
|
|
protected $description = 'Generate a theme scaffold with metadata, layout and assets.';
|
|
|
|
public function handle(ThemeGenerator $generator): int
|
|
{
|
|
try { $files = $generator->generate($this->argument('name'), (bool) $this->option('force')); }
|
|
catch (Throwable $e) { $this->error($e->getMessage()); return self::FAILURE; }
|
|
foreach ($files as $file) { $this->line("<info>created</info> {$file}"); }
|
|
return self::SUCCESS;
|
|
}
|
|
}
|