mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-09 18:19:27 +01:00
make name & author optional in create plugin command
This commit is contained in:
parent
b6ba12e513
commit
7c8454276e
@ -9,8 +9,8 @@ use Illuminate\Filesystem\Filesystem;
|
|||||||
class CreatePluginCommand extends Command
|
class CreatePluginCommand extends Command
|
||||||
{
|
{
|
||||||
protected $signature = 'p:plugin:create
|
protected $signature = 'p:plugin:create
|
||||||
{name}
|
{--name=}
|
||||||
{author}
|
{--author=}
|
||||||
{--description=}
|
{--description=}
|
||||||
{--category=}
|
{--category=}
|
||||||
{--url=}
|
{--url=}
|
||||||
@ -27,7 +27,7 @@ class CreatePluginCommand extends Command
|
|||||||
|
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
$name = $this->argument('name');
|
$name = $this->option('name') ?? $this->ask('Name');
|
||||||
$id = str_slug(strtolower($name));
|
$id = str_slug(strtolower($name));
|
||||||
|
|
||||||
if ($this->filesystem->exists(plugin_path($id))) {
|
if ($this->filesystem->exists(plugin_path($id))) {
|
||||||
@ -36,7 +36,7 @@ class CreatePluginCommand extends Command
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$author = $this->argument('author');
|
$author = $this->option('$author') ?? $this->ask('$author');
|
||||||
|
|
||||||
$namespace = $author . '\\' . studly_case($name);
|
$namespace = $author . '\\' . studly_case($name);
|
||||||
$class = studly_case($name . 'Plugin');
|
$class = studly_case($name . 'Plugin');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user