Skip to content

Commit

Permalink
Merge pull request #1027 from cakephp/bug/standalone-plugin
Browse files Browse the repository at this point in the history
Don't ask for plugin path again for a vendor plugin.
  • Loading branch information
markstory authored Jan 17, 2025
2 parents e94334b + 3400f76 commit 165e2bd
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/Command/PluginCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ class PluginCommand extends BakeCommand

protected bool $isVendor = false;

/**
* initialize
*
* @return void
*/
public function initialize(): void
{
parent::initialize();
$this->path = current(App::path('plugins'));
}

/**
* Execute the command.
*
Expand Down Expand Up @@ -114,10 +103,15 @@ public function execute(Arguments $args, ConsoleIo $io): ?int
*/
public function bake(string $plugin, Arguments $args, ConsoleIo $io): ?bool
{
$pathOptions = App::path('plugins');
if (count($pathOptions) > 1) {
$this->findPath($pathOptions, $io);
if (!$this->isVendor) {
$pathOptions = App::path('plugins');
$this->path = current($pathOptions);

if (count($pathOptions) > 1) {
$this->findPath($pathOptions, $io);
}
}

$io->out(sprintf('<info>Plugin Name:</info> %s', $plugin));
$io->out(sprintf('<info>Plugin Directory:</info> %s', $this->path . $plugin));
$io->hr();
Expand Down

0 comments on commit 165e2bd

Please sign in to comment.