Skip to content

Commit 5603240

Browse files
gladtoeatufrank
andauthored
Optimize plugin namespace (#139)
* 规范应用 namespace * 规范应用 namespace --------- Co-authored-by: frank <noikiy@qq.com>
1 parent ad09e83 commit 5603240

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Command/CreateCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ public function createNamespace(string $path, string $name): string
6969

7070
public function createMineJson(string $path, string $name, PluginTypeEnum $pluginType): void
7171
{
72+
$pluginPath = Str::replace(Plugin::PLUGIN_PATH . '/', '', $path);
73+
7274
$output = new \stdClass();
73-
$output->name = $name;
75+
$output->name = $pluginPath ?? $name;
7476
$output->version = '1.0.0';
7577
$output->type = $pluginType->value;
7678
$output->description = $this->input->getOption('description') ?: 'This is a sample plugin';

0 commit comments

Comments
 (0)