update command
parent
fb88053b95
commit
5a3afa371f
|
|
@ -14,8 +14,8 @@ class ExtensionMakeCommand extends Command
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'admin:ext-make
|
||||
{name : The name of the extension. Eg: author-name/extension-name}
|
||||
protected $signature = 'admin:ext-make
|
||||
{name : The name of the extension. Eg: author-name/extension-name}
|
||||
{--namespace= : The namespace of the extension.}
|
||||
{--theme}
|
||||
';
|
||||
|
|
@ -97,11 +97,12 @@ class ExtensionMakeCommand extends Command
|
|||
if (! file_exists($this->extensionDir)) {
|
||||
$this->makeDir();
|
||||
}
|
||||
$name = $this->argument('name');
|
||||
|
||||
$this->package = str_replace('.', '/', $this->argument('name'));
|
||||
$this->package = str_replace('.', '/', 'Peidikeji/'.ucfirst($name));
|
||||
$this->extensionName = str_replace('/', '.', $this->package);
|
||||
|
||||
$this->basePath = rtrim($this->extensionDir, '/').'/'.ltrim($this->package, '/');
|
||||
$this->basePath = rtrim($this->extensionDir, '/').'/'.ltrim(strtolower($name), '/');
|
||||
|
||||
if (is_dir($this->basePath)) {
|
||||
return $this->error(sprintf('The extension [%s] already exists!', $this->package));
|
||||
|
|
@ -188,7 +189,7 @@ TREE;
|
|||
// make composer.json
|
||||
$composerContents = str_replace(
|
||||
['{package}', '{alias}', '{namespace}', '{className}'],
|
||||
[$this->package, '', str_replace('\\', '\\\\', $this->namespace).'\\\\', $this->className],
|
||||
[strtolower($this->package), strtolower($this->className), str_replace('\\', '\\\\', $this->namespace).'\\\\', $this->className],
|
||||
file_get_contents(__DIR__.'/stubs/extension/composer.json.stub')
|
||||
);
|
||||
$this->putFile('composer.json', $composerContents);
|
||||
|
|
|
|||
Loading…
Reference in New Issue