From 4eae25ab0254a7057de503c0abf2516a9c8d5611 Mon Sep 17 00:00:00 2001 From: Maxime Renou Date: Mon, 8 Apr 2024 17:18:39 +0200 Subject: [PATCH] fix autoloading --- src/Console/ProxyCommand.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Console/ProxyCommand.php b/src/Console/ProxyCommand.php index b7b156b..e61caeb 100644 --- a/src/Console/ProxyCommand.php +++ b/src/Console/ProxyCommand.php @@ -23,10 +23,14 @@ abstract class ProxyCommand extends Command public function handle() { foreach (self::PACKAGES as $package) { - if (! is_dir("{$this->base_path}/packages/$package")) { + $package_path = "{$this->base_path}/packages/$package"; + + if (! is_dir($package_path)) { $this->error("🚨 Missing package bag/$package. Please run 'php artisan bag:install' first."); return 1; } + + require_once $package_path.'/vendor/autoload.php'; } try { @@ -75,8 +79,6 @@ abstract class ProxyCommand extends Command $this->info("🐠 Loading bag/$package..."); $result = Process::path($package_path)->run("composer install --ignore-platform-reqs"); - require_once $package_path.'/vendor/autoload.php'; - - $this->info("⚡️ Ready!"); + $this->info("⚡️ Installed!"); } }