From 52a4f64979b5e5de631a0b47182671632adefe53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojtek=20Sza=C5=82kiewicz?= Date: Thu, 25 Apr 2024 13:35:56 +0200 Subject: [PATCH] feat: add else block for package relative path --- src/Composer/ComposerPackage.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Composer/ComposerPackage.php b/src/Composer/ComposerPackage.php index 972eb05c..135b6fc2 100644 --- a/src/Composer/ComposerPackage.php +++ b/src/Composer/ComposerPackage.php @@ -7,6 +7,7 @@ namespace BrianHenryIE\Strauss\Composer; +use BrianHenryIE\Strauss\Helpers\Path; use Composer\Composer; use Composer\Factory; use Composer\IO\NullIO; @@ -128,6 +129,8 @@ public function __construct(Composer $composer, array $overrideAutoload = null) } elseif (1 === preg_match('/.*\/([^\/]*\/[^\/]*)\/composer.json/', $composerJsonFileAbsolute, $output_array)) { // Not every package gets installed to a folder matching its name (crewlabs/unsplash). $this->relativePath = $output_array[1]; + } else { + $this->relativePath = Path::normalize($this->packageName); } if (!is_null($overrideAutoload)) {