From 3400f76c18441e9f4eeb72dec7b2ddbb40ea72c6 Mon Sep 17 00:00:00 2001 From: ADmad Date: Thu, 16 Jan 2025 22:27:38 +0530 Subject: [PATCH] Don't ask for plugin path again for a vendor plugin. The path is already provided using the `--standalone-path` option. --- src/Command/PluginCommand.php | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/Command/PluginCommand.php b/src/Command/PluginCommand.php index 053006aa..fb2c83fc 100644 --- a/src/Command/PluginCommand.php +++ b/src/Command/PluginCommand.php @@ -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. * @@ -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('Plugin Name: %s', $plugin)); $io->out(sprintf('Plugin Directory: %s', $this->path . $plugin)); $io->hr();