Skip to content

Commit 165e2bd

Browse files
authored
Merge pull request #1027 from cakephp/bug/standalone-plugin
Don't ask for plugin path again for a vendor plugin.
2 parents e94334b + 3400f76 commit 165e2bd

1 file changed

Lines changed: 8 additions & 14 deletions

File tree

src/Command/PluginCommand.php

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,6 @@ class PluginCommand extends BakeCommand
4545

4646
protected bool $isVendor = false;
4747

48-
/**
49-
* initialize
50-
*
51-
* @return void
52-
*/
53-
public function initialize(): void
54-
{
55-
parent::initialize();
56-
$this->path = current(App::path('plugins'));
57-
}
58-
5948
/**
6049
* Execute the command.
6150
*
@@ -114,10 +103,15 @@ public function execute(Arguments $args, ConsoleIo $io): ?int
114103
*/
115104
public function bake(string $plugin, Arguments $args, ConsoleIo $io): ?bool
116105
{
117-
$pathOptions = App::path('plugins');
118-
if (count($pathOptions) > 1) {
119-
$this->findPath($pathOptions, $io);
106+
if (!$this->isVendor) {
107+
$pathOptions = App::path('plugins');
108+
$this->path = current($pathOptions);
109+
110+
if (count($pathOptions) > 1) {
111+
$this->findPath($pathOptions, $io);
112+
}
120113
}
114+
121115
$io->out(sprintf('<info>Plugin Name:</info> %s', $plugin));
122116
$io->out(sprintf('<info>Plugin Directory:</info> %s', $this->path . $plugin));
123117
$io->hr();

0 commit comments

Comments
 (0)